!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("photoeditorsdk/js/PhotoEditorSDK"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["photoeditorsdk","react","react-dom"],t):"object"==typeof exports?exports.PhotoEditorDesktopUI=t(require("photoeditorsdk/js/PhotoEditorSDK"),require("react"),require("react-dom")):e.PhotoEditorDesktopUI=t(e.PhotoEditorSDK,e.React,e.ReactDOM)}("undefined"!=typeof self?self:this,function(e,t,n){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=152)}([function(e,t,n){e.exports={default:n(154),__esModule:!0}},function(e,t,n){e.exports={default:n(164),__esModule:!0}},function(e,t,n){e.exports={default:n(156),__esModule:!0}},function(e,t,n){e.exports={default:n(159),__esModule:!0}},function(e,t,n){"use strict";(function(e){n.d(t,"j",function(){return T}),n.d(t,"w",function(){return P}),n.d(t,"l",function(){return M}),n.d(t,"r",function(){return O}),n.d(t,"e",function(){return E}),n.d(t,"c",function(){return C}),n.d(t,"a",function(){return S}),n.d(t,"p",function(){return R}),n.d(t,"i",function(){return x}),n.d(t,"q",function(){return I}),n.d(t,"z",function(){return F}),n.d(t,"f",function(){return D}),n.d(t,"o",function(){return A}),n.d(t,"x",function(){return w});var i=n(7),r=n.n(i),o=n(39),a=n.n(o),s=n(166),l=n.n(s),c=n(24),u=n.n(c),f=n(95),p=n(170),d=n.n(p),h=n(96),_=n(187),m=n(221),g=n(227),y=n(15),v=n(51),b=n(25),k=n(79);n.d(t,"v",function(){return _.a}),n.d(t,"m",function(){return a.a}),n.d(t,"b",function(){return h.a}),n.d(t,"d",function(){return m.a}),n.d(t,"t",function(){return g.a}),n.d(t,"n",function(){return l.a}),n.d(t,"A",function(){return y.b}),n.d(t,"y",function(){return y.a}),n.d(t,"h",function(){return v.a}),n.o(p,"withTheme")&&n.d(t,"B",function(){return p.withTheme}),n.o(p,"ThemeProvider")&&n.d(t,"u",function(){return p.ThemeProvider}),n.d(t,"g",function(){return b.a}),n.d(t,"k",function(){return u.a}),n.d(t,"s",function(){return k.b});var w=new d.a(e.adonisOptions||{injection:!1,theme:f.a,minified:!0,cssSelectorPrefix:".pesdk-desktop-editor ",classNamePrefix:"pesdk-",hashedStyles:!0}),S=r.a.Base64,C=r.a.Color,E=(r.a.Math.ColorMatrix,r.a.EventEmitter),x=(r.a.EXIF,r.a.OptionType),T=r.a.Promise,O=r.a.Utils,R=r.a.RenderType,D=r.a.ImageFormat,I=r.a,P=(r.a.UniformType,r.a.Math.Vector2),A=r.a.Math.Rectangle,M=r.a.Math.Range,F="undefined"!=typeof window&&window.performance&&window.performance.now?window.performance.now.bind(window.performance):n(111)}).call(t,n(30))},function(e,t,n){e.exports=n(153).default},function(e,t,n){e.exports={default:n(233),__esModule:!0}},function(t,n){t.exports=e},function(e,t,n){e.exports={default:n(171),__esModule:!0}},function(e,t,n){e.exports={default:n(193),__esModule:!0}},function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(e,t,n){var i=n(12),r=n(10),o=n(27),a=n(22),s=n(23),l=function(e,t,n){var c,u,f,p=e&l.F,d=e&l.G,h=e&l.S,_=e&l.P,m=e&l.B,g=e&l.W,y=d?r:r[t]||(r[t]={}),v=y.prototype,b=d?i:h?i[t]:(i[t]||{}).prototype;for(c in d&&(n=t),n)(u=!p&&b&&void 0!==b[c])&&s(y,c)||(f=u?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:m&&u?o(f,i):g&&b[c]==f?function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):_&&"function"==typeof f?o(Function.call,f):f,_&&((y.virtual||(y.virtual={}))[c]=f,e&l.R&&v&&!v[c]&&a(v,c,f)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var i=n(69)("wks"),r=n(47),o=n(12).Symbol,a="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=i},function(e,t,n){var i=n(17);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";(function(e){n.d(t,"b",function(){return r}),n.d(t,"a",function(){return o});for(var i="undefined"==typeof window?e:window,r=i.requestAnimationFrame,o=i.cancelAnimationFrame,a=0,s=["ms","moz","webkit","o"],l=0;l<s.length&&!r;++l)r=i[s[l]+"RequestAnimationFrame"],o=i[s[l]+"CancelAnimationFrame"]||i[s[l]+"CancelRequestAnimationFrame"];r&&(r=r.bind(i)),o&&(o=o.bind(i)),r||(r=function(e,t){var n=(new Date).getTime(),i=Math.max(0,16-(n-a)),r=setTimeout(function(){e(n+i)},i);return a=n+i,r}),o||(o=function(e){clearTimeout(e)})}).call(t,n(30))},function(e,t,n){var i=n(14),r=n(90),o=n(62),a=Object.defineProperty;t.f=n(18)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(28)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(91),r=n(64);e.exports=function(e){return i(r(e))}},function(e,t,n){e.exports={default:n(188),__esModule:!0}},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onDragStart","_onDragMove","_onDragEnd"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,_.b),g(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this.refs.element&&(this._element=this.refs.element)}},{key:"componentWillReceiveProps",value:function(e){var t=e.disabled;if(this.props.disabled===t)return!1}},{key:"_onDragStart",value:function(e){if(!this.props.disabled){e.preventDefault(),e.stopPropagation(),this._initialMousePosition=_.v.getEventPosition(e),window.MSInputMethodContext&&document.documentMode?(document.addEventListener("mousemove",this._onDragMove),document.addEventListener("touchmove",this._onDragMove)):(document.addEventListener("mousemove",this._onDragMove,{passive:!1}),document.addEventListener("touchmove",this._onDragMove,{passive:!1})),document.addEventListener("mouseup",this._onDragEnd),document.addEventListener("touchend",this._onDragEnd);var t=this._element.getBoundingClientRect(),n=new _.w(t.left,t.top);this._lastMousePosition=this._initialMousePosition.clone();var i=this._initialMousePosition.clone().subtract(n);this.props.onStart&&this.props.onStart(i,this._initialMousePosition.clone(),e)}}},{key:"_onDragMove",value:function(e){e.preventDefault(),e.stopPropagation();var t=_.v.getEventPosition(e);if(t){var n=t.clone().subtract(this._initialMousePosition),i=t.clone().subtract(this._lastMousePosition);this._lastMousePosition=t.clone(),this.props.onDrag&&this.props.onDrag(n,t,i,e)}}},{key:"_onDragEnd",value:function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._onDragMove(e),document.removeEventListener("mousemove",this._onDragMove),document.removeEventListener("touchmove",this._onDragMove),document.removeEventListener("mouseup",this._onDragEnd),document.removeEventListener("touchend",this._onDragEnd),this.props.onStop&&this.props.onStop(e)}},{key:"render",value:function(){var e=this;if(!this.props.children||this.props.children instanceof Array)throw new Error("DraggableComponent expects exactly one child.");var t={onMouseDown:this._onDragStart,onTouchStart:this._onDragStart,tabIndex:0,style:m({},this.props.children.props.style||{},{touchAction:"none"}),onClick:function(t){var n=_.v.getEventPosition(t),i=e._initialMousePosition;if(!n||!i||n.equals(i)){var r=e.props.children.props.onClick;return document.removeEventListener("mousemove",e._onDragMove),document.removeEventListener("touchmove",e._onDragMove),document.removeEventListener("mouseup",e._onDragEnd),document.removeEventListener("touchend",e._onDragEnd),void(r&&r(t))}t.stopPropagation()}};if("string"==typeof this.props.children.type)t.ref="element";else{var n=this.props.children.props.innerRef;t.innerRef=function(t){e._element=t,n&&n(t)}}return _.m.cloneElement(this.props.children,t)}}]),t}();y.contextTypes=_.b.contextTypes,y.propTypes={onStart:_.k.func,onDrag:_.k.func,onStop:_.k.func,disabled:_.k.bool},t.a=y},function(e,t,n){var i=n(16),r=n(34);e.exports=n(18)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){e.exports=n(167)()},function(e,t,n){"use strict";var i=n(110),r=n.n(i),o=n(32),a=n.n(o),s=n(8),l=n.n(s),c=function(){return function(e,t){if(Array.isArray(e))return e;if(r()(Object(e)))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,l=a()(e);!(i=(s=l.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&l.return&&l.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.a={load:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{cors:!0,value:"anonymous"};return(e.substr(0,5),l.a.resolve([e,e])).then(function(e){var i=c(e,2),r=i[0],o=i[1];return t._createAndLoadImage(r,o,n)})},_createAndLoadImage:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{cors:!0,value:"anonymous"};return new l.a(function(e,r){var o=new l.a(function(e,n){var r=new window.Image;r.addEventListener("load",function(){e(r)}),r.addEventListener("error",function(){n(new Error("Failed to load image at "+t))}),i.cors&&(r.crossOrigin=i.value),r.src=t}),a=new l.a(function(e,r){n._loadAsDataURL(t,i).then(function(t){var n=new window.Image;n.addEventListener("load",function(){e(n)}),n.src=t,n.rawSource=t}).catch(function(t){o.then(function(t){return e(t)})})});return n._stringEndsWith(t,".svg")?o.then(function(t){return e(t)}):a.then(function(t){return e(t)})})},_stringEndsWith:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t},_loadAsDataURL:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{cors:!0,value:"anonymus"};return new l.a(function(n,i){var r=new XMLHttpRequest;r.onload=function(){var e=new FileReader;e.onloadend=function(){e.error&&i(e.error),n(e.result)},e.readAsDataURL(r.response)},r.open("GET",e),r.responseType="blob",r.withCredentials=t.cors&&"use-credentials"===t.value,r.send()})},loadXHR:function(e,t){return new l.a(function(n,i){var r=void 0;window.XDomainRequest?(r=new window.XDomainRequest,t&&r.overrideMimeType(t),r.onload=function(){n(r)},r.onerror=function(e){i(e)}):window.XMLHttpRequest&&(r=new window.XMLHttpRequest,t&&r.overrideMimeType(t),r.onreadystatechange=function(e){4===r.readyState&&(200===r.status?n(r):i(new Error("HTTP Status "+r.status)))}),r.open("GET",e,!0),r.send()})}}},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(4),l=n(256),c=n(51),u=n(120),f=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._fonts=[],this._variationsByIdentifier={},this._fontsByFontFamily={},this._initFonts()}return p(e,[{key:"_initFonts",value:function(){var e=this,t=this._options,n=t.fonts,i=t.replaceFonts,r=t.availableVariations,o=s.d.DEFAULTS.FONTS,a=void 0;o=(o=i?n:o.concat(n||[])).map(function(t){var n=t.fontFamily,i=t.variations;if(r&&(i=i.filter(function(e){return-1!==r.indexOf(e.identifier)})),0===i.length)return null;var o=new l.a({fontFamily:n});return i=i.map(function(t){var i=new u.a(t);return i.setFontFamily(n),i.setFont(o),t.default&&!a&&(a=i),null==i.getTextMetrics()&&c.a.warn("Missing font metrics for "+i.getIdentifier()+". The SDK will fall back to basic font rendering, which may lead to layout issues. Please provide font metrics for your custom fonts. See https://docs.photoeditorsdk.com/guides/html5/ for more details."),e._variationsByIdentifier[i.getIdentifier()]=i,i}),o.setVariations(i),e._fontsByFontFamily[n]=o,o}).filter(function(e){return e}),a||(a=o[0].getVariations()[0]),this._defaultVariation=a,this._fonts=o}},{key:"getFonts",value:function(){return this._fonts}},{key:"getFontByFontFamily",value:function(e){return this._fontsByFontFamily[e]}},{key:"getVariationByIdentifier",value:function(e){return this._variationsByIdentifier[e]}},{key:"getVariationsByIdentifier",value:function(){return f({},this._variationsByIdentifier)}},{key:"getDefaultVariation",value:function(){return this._defaultVariation}}]),e}();t.a=d},function(e,t,n){var i=n(46);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var i=n(92),r=n(70);e.exports=Object.keys||function(e){return i(e,r)}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports={}},function(e,t,n){e.exports={default:n(230),__esModule:!0}},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return o()(e)}var r=n(20),o=n.n(r),a=n(9),s=n.n(a),l=n(0),c=n.n(l),u=n(267),f=n.n(u),p=n(43),d=n.n(p),h=n(4),_=s.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),c()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._defaultLayouts=h.q.Operations.SpriteOperation.TextDesignSprite.Layouts,this._legacyLayouts=h.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts,this._layouts=[],this._init()}return m(e,[{key:"_init",value:function(){var e=this._options.availableLayouts,t=_({},this._defaultLayouts,this._legacyLayouts);this._layouts=d()(t).map(function(e){return{identifier:t[e].identifier,layout:t[e]}}),e&&(e.push.apply(e,i(f()(this._legacyLayouts).map(function(e){return e.identifier}))),this._layouts=this._layouts.filter(function(t){return e.indexOf(t.identifier)>=0}))}},{key:"getLayoutByIdentifier",value:function(e){var t=h.r.Array.find(this._layouts,function(t){return t.identifier===e});return t&&t.layout}},{key:"getLayouts",value:function(){return[].concat(i(this._layouts))}},{key:"getDefaultLayout",value:function(){return this.getLayouts()[0]}}]),e}();t.a=g},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t,n){var i=n(64);e.exports=function(e){return Object(i(e))}},function(e,n){e.exports=t},function(e,t,n){"use strict";var i=n(172)(!0);n(98)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){e.exports={default:n(196),__esModule:!0}},function(e,t,n){e.exports={default:n(197),__esModule:!0}},function(e,t,n){e.exports={default:n(204),__esModule:!0}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}var a=n(0),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(4),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(e,n,o){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];i(this,t);var l=r(this,(t.__proto__||d()(t)).call(this));return l.id=h.r.getUUID(),l.type=e,l.title=n,l.text=o,l.overlay=a,l.closeOnOverlayClick=s,l.visible=!0,l.data=null,l}return o(t,h.e),_(t,[{key:"setData",value:function(e){this.data=e,this.emit("update")}},{key:"close",value:function(){this.visible=!1,this.emit("close")}},{key:"remove",value:function(){this.emit("remove")}}]),t}(),g=function(e){function t(){i(this,t);var e=r(this,(t.__proto__||d()(t)).call(this));return e._modals=[],e}return o(t,h.e),_(t,[{key:"displayLoading",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new m("loading",e,null,t);return this.addModal(n),n}},{key:"displayProgress",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new m("progress",null,e,n);return i.setData({progress:t}),this.addModal(i),i}},{key:"displayInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new m("input",e,null,n,!0);return i.setData({text:t}),this.addModal(i),i}},{key:"displayWarning",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["OK"],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=new m("warning",e,t,i);return r.setData({buttons:n}),this.addModal(r),r}},{key:"displayError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=new m("error",e,t,n);return this.addModal(i),i}},{key:"addModal",value:function(e){var t=this;this._modals.push(e),e.on("close",function(){t.emit("update")}),e.on("remove",function(){t.removeModal(e)}),e.on("update",function(){t.emit("update")}),this.emit("update")}},{key:"removeModal",value:function(e){var t=this._modals.indexOf(e);this._modals.splice(t,1),this.emit("update")}},{key:"getModals",value:function(){return this._modals}}],[{key:"instance",get:function(){return this._instance||(this._instance=new t),this._instance}}]),t}();t.a=g},function(e,t,n){"use strict";n.d(t,"f",function(){return g}),n.d(t,"b",function(){return y}),n.d(t,"d",function(){return v}),n.d(t,"a",function(){return w}),n.d(t,"e",function(){return S}),n.d(t,"c",function(){return C});var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._buttons=[],o.state={visible:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),h(t,[{key:"componentDidMount",value:function(){for(var e,n=this,i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];(e=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this)).call.apply(e,[this].concat(r));var s=this.props.modal;s.on("close",function(){n.setState({visible:!1}),setTimeout(function(){s.remove()},1e3*n.context.theme.transitionDuration)}),Object(d.A)(function(){n.setState({visible:!0})})}},{key:"_onButtonClick",value:function(e,t){t.preventDefault()}},{key:"_renderButtons",value:function(){var e=this;return this._buttons.map(function(t,n){return d.m.createElement(k,{key:n,onClick:e._onButtonClick.bind(e,n)},t)})}},{key:"render",value:function(){var e=this.props.modal,t=function(e,t,n){return t in e?r()(e,t,{value:!0,enumerable:!0,configurable:!0,writable:!0}):e[t]=!0,e}({},e.type),n=this._buttons.length?d.m.createElement(b,null,this._renderButtons()):null,i=this._renderContent&&this._renderContent();return i?d.m.createElement(m,{visible:this.state.visible,large:this.state.large},i,d.m.createElement(E,{onClick:this._onClickOverlay,visible:!this.state.visible})):d.m.createElement(m,{visible:this.state.visible},d.m.createElement(g,t,d.m.createElement(y,null,d.m.createElement(w,{src:this._getAssetPath("shared/modals/icon.png",!0)})),d.m.createElement(v,null,d.m.createElement(S,null,e.title),d.m.createElement(C,null,e.text))),n,d.m.createElement(E,{onClick:this._onClickOverlay,visible:!this.state.visible}))}}]),t}();_.propTypes={modal:d.k.object},_.contextTypes=d.b.contextTypes,t.g=_;var m=d.x.div("1jkivgb",{visible:"7bce9v",large:"1mlpyuc"},"Modal"),g=d.x.div("1udylfs",{error:"120drhm",warning:"120drhm",loading:"120drhm"},"Top"),y=d.x.div("z6arf2","IconContainer"),v=d.x.div("245la5","TextContainer"),b=d.x.div("1943606","Buttons"),k=d.x.div("1kylmay","Button"),w=d.x.img("jsue2c","Icon"),S=d.x.div("1fx19is","Title"),C=d.x.div("1id6172","Text"),E=d.x.div("mv80g2",{visible:"2jlos"},"BlockingOverlay")},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},function(e,t,n){var i=n(11),r=n(10),o=n(28);e.exports=function(e,t){var n=(r.Object||{})[e]||Object[e],a={};a[e]=t(n),i(i.S+i.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){var i=n(16).f,r=n(23),o=n(13)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t,n){n(174);for(var i=n(12),r=n(22),o=n(31),a=n(13)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var c=s[l],u=i[c],f=u&&u.prototype;f&&!f[a]&&r(f,a,c),o[c]=o.Array}},function(e,t,n){"use strict";(function(e){function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return o()(e)}var r=n(20),o=n.n(r),a=n(0),s=n.n(a),l=n(107),c=n.n(l),u=n(192),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),p=[{name:"trace",type:"trace",background:"#EEEEEE",color:"#AAAAAA"},{name:"info",type:"log",background:"#BDE5F8",color:"#00529B"},{name:"warn",type:"warn",background:"#FEEFB3",color:"#9F6000"},{name:"error",type:"error",background:"#FFBABA",color:"#D8000C"},{name:"log",type:"log",background:"#EEEEEE",color:"#1f4f6b"}],d=function(){return console&&console.group&&console.groupCollapsed&&console.groupEnd},h=new(function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"warn",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this._levels=[].concat(i(r)),this._maxLevel=this.getLevelIndexByName(n),this._consoleFuncs={trace:function(){var e,t;d()?((e=console).groupCollapsed.apply(e,arguments),console.trace(),console.groupEnd()):(t=console).trace.apply(t,arguments)}},this._levels.forEach(function(t){var n=t.name;e[n]=function(t){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];e._log.apply(e,[n,t].concat(r))}})}return f(t,[{key:"getLevelIndexByName",value:function(e){return u.a.Array.findIndex(this._levels,function(t){return t.name===e})}},{key:"getLevelObjectByName",value:function(e){return u.a.Array.find(this._levels,function(t){return t.name===e})}},{key:"canLog",value:function(e){var t=this.getLevelIndexByName(e);return!(t<0)&&t>=this._maxLevel}},{key:"setLevel",value:function(e){var t=this.getLevelIndexByName(e);t<0||(this._maxLevel=t)}},{key:"_log",value:function(t,n){for(var r=arguments.length,o=Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];var s=this.getLevelObjectByName(t);if(s&&this.canLog(t)){s.name;var l,f=s.type,p=s.background,h=s.color,_=o.filter(function(e){return void 0!==e}).map(function(e){return e.toObject?JSON.parse(c()(e.toObject())):e}),m=this._consoleFuncs[f]||console[f]?function(){var e;return(e=console)[f].apply(e,arguments)}:function(){var e;return(e=console).log.apply(e,arguments)},g=_.length,y=function(e,t){return["background: #2D7BFF; line-height: 20px; padding: 4px 0","background: #2B2B2B; color: white; line-height: 20px; padding: 4px 0","background: #2D7BFF; line-height: 20px; padding: 4px 0","background: "+e+"; color: "+t+"; line-height: 20px; padding: 4px 0; font-weight: bold","background: #2B2B2B; color: white; line-height: 20px; padding: 4px 0","background: #2D7BFF; line-height: 20px; padding: 4px 0"]}(p,h);if(!(!e||e&&e.browser)||"undefined"==typeof navigator||!navigator.userAgent.match(/Gecko|WebKit/i)||navigator.userAgent.match(/Trident/)){var v=_.length;return v<=0?void m("PhotoEditorSDK | "+n+" "):1===v&&"string"==typeof _[0]?void m("PhotoEditorSDK | "+n+" | "+_[0]):void m.apply(void 0,["PhotoEditorSDK | "+n+" | "].concat(i(_)))}g<=0?m.apply(void 0,["%c  %c PhotoEditorSDK %c  %c "+n+" %c %c  "].concat(i(y))):1!==g||"string"!=typeof _[0]?d()?((l=console).groupCollapsed.apply(l,["%c  %c PhotoEditorSDK %c  %c "+n+" %c"].concat(i(u.a.Array.init(y)))),m.apply(void 0,i(_)),console.groupEnd()):m.apply(void 0,["%c  %c PhotoEditorSDK %c  %c "+n+" %c"].concat(i(u.a.Array.init(y)),i(_))):m.apply(void 0,["%c  %c PhotoEditorSDK %c  %c "+n+" %c  "+_[0]+"  %c  "].concat(i(y)))}}},{key:"image",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],n=new window.Image,i=function(){var t=n.width,i=n.height;e&&console.log(e),console.log("%c+","\n        font-size: 1px;\n        padding: 0px "+Math.floor(t/2)+"px;\n        line-height: "+i+"px;\n        background: url("+n.src+");\n        color: transparent;\n        background-repeat: no-repeat;\n        background-size: "+t+"px "+i+"px;")};return n.onload=i,t instanceof window.HTMLCanvasElement?n.src=t.toDataURL():t instanceof window.Image?(n=t,i()):"string"==typeof t?n.src=t:this.log(e,t),n}},{key:"texture",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];if(t){var n=t.getBaseTexture(),i=n.getRenderers(),r=u.a.Array.find(i,function(e){return e&&"WebGL"===e.constructor.type}),o=n.getFrame(),a=o.width,s=o.height;if(r){var l=r.getContext(),c=n.getGLTextureForRenderer(r);this.logGlTexture(l,c,a,s,e)}else h.image(e,n.getSource())}else this.log(e,"texture: null or undefined")}},{key:"logGlTexture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:150,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:150,r=arguments[4];e.bindTexture(e.TEXTURE_2D,t);var o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0);var a=new Uint8Array(n*i*4);e.readPixels(0,0,n,i,e.RGBA,e.UNSIGNED_BYTE,a),e.deleteFramebuffer(o);var s=document.createElement("canvas");s.width=n,s.height=i;var l=s.getContext("2d"),c=l.createImageData(n,i);return c.data.set(a),l.putImageData(c,0,0),h.image(r,s)}}]),t}())("warn");t.a=h}).call(t,n(106))},function(e,t,n){"use strict";(function(e){var i=n(0),r=n.n(i),o=n(209),a=n(213),s=n.n(a),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c="undefined"!=typeof window?window:e,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._url=t,this._parsedUrl=s.a.parse(this._url,!0)}return l(e,[{key:"_isJSONPRequest",value:function(){var e=this._parsedUrl.query;for(var t in e)if("?"===e[t])return!0;return!1}},{key:"load",value:function(){return this._isJSONPRequest()?this._loadJSONP():this._loadJSON()}},{key:"_loadJSON",value:function(){var e=this;return new o.a(function(t,n){var i=void 0;c.XDomainRequest?((i=new c.XDomainRequest).onload=function(){var e=JSON.parse(i.responseText);t(e)},i.onerror=function(e){n(e)},i.open("GET",e._url,!0),i.send()):c.XMLHttpRequest&&((i=new XMLHttpRequest).onreadystatechange=function(e){if(4===i.readyState)if(200===i.status){var r=JSON.parse(i.responseText);t(r)}else n(new Error("HTTP Status "+i.status))},i.open("GET",e._url,!0),i.send())})}},{key:"_loadJSONP",value:function(){var e=this,t=!1,n=!1,i="pesdk"+Math.round(99999999999999*Math.random());return new o.a(function(r,o){var a=e._createJSONPNode(i);c[i]=function(i){e._removeJSONPNode(a),t||(n=!0,r(i))},c.setTimeout(function(){n||(e._removeJSONPNode(a),t=!0,o(new Error("Timeout of 5 seconds exceeded.")))},5e3)})}},{key:"_createJSONPNode",value:function(e){var t=this._buildJSONPUrl(e),n=document.querySelector("head"),i=document.createElement("script");return i.src=t,n.appendChild(i),i}},{key:"_removeJSONPNode",value:function(e){e.parentNode.removeChild(e)}},{key:"_buildJSONPUrl",value:function(e){var t=this._parsedUrl.query,n=null;for(var i in t)if("?"===t[i]){n=i;break}return delete this._parsedUrl.search,t[n]=e,s.a.format(this._parsedUrl)}}]),e}();t.a=u}).call(t,n(30))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(39),p=n.n(f),d=n(24),h=n.n(d),_=n(15),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._timeout=null,o.state={enter:!1,appear:!1,leave:!1},o.props.active&&(o.state.enter=!0,o.state.appear=!0),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.Component),m(t,[{key:"componentWillReceiveProps",value:function(e){this.props.active&&!e.active?this._leave():!this.props.active&&e.active&&(this._enter(),this._appear())}},{key:"_cancelTimeout",value:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null)}},{key:"_enter",value:function(){this.setState({enter:!0})}},{key:"_leave",value:function(){var e=this;this._timeout&&this._cancelTimeout(),this.setState({appear:!1,leave:!0}),this._timeout=window.setTimeout(function(){e._cancelTimeout(),e.setState({enter:!1})},this.props.leaveDuration)}},{key:"_appear",value:function(){var e=this;this._timeout&&this._cancelTimeout(),Object(_.b)(function(){e.setState({appear:!0,leave:!1}),e._timeout=window.setTimeout(function(){e._cancelTimeout()},e.props.appearDuration)})}},{key:"_buildStateProps",value:function(){var e=this.props,t=e.enterProp,n=e.appearProp,i=e.leaveProp,r={};return t&&(r[t]=this.state.enter),n&&(r[n]=this.state.appear),i&&(r[i]=this.state.leave),r}},{key:"render",value:function(){if(!this.props.children)return null;var e=this._buildStateProps();return p.a.cloneElement(this.props.children,e)}}]),t}();g.propTypes={active:h.a.bool,enterProp:h.a.string,enterDuration:h.a.number,appearProp:h.a.string,appearDuration:h.a.number,leaveProp:h.a.string,leaveDuration:h.a.number},g.defaultProps={active:!0,enterProp:"rendered",enterDuration:300,appearProp:"visible",appearDuration:300,leaveDuration:300},t.a=g},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(9),a=n.n(o),s=n(32),l=n.n(s),c=n(7),u=(n.n(c),n(4)),f=n(79),p=n(52),d=n(114),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._dynamicAssetsLibrary=i||this._ui.getEditor().getDynamicAssetsLibrary()||new d.a,this._categoriesById={},this._categories=[],this._stickersById={},this._customStickerCanvas=c.Utils.createCanvas(),this.reload()}return h(e,[{key:"reload",value:function(){this._categoriesById={},this._categories=[],this._stickersById={},this._addCategories(f.b.DEFAULTS.STICKER_CATEGORIES);var e=this._options,t=e.categories,n=e.replaceCategories;this._options.categories?this._addCategories(t,n):(this._updateCategoriesMap(),this._updateAllCategory());var i=this._dynamicAssetsLibrary.getAssets("sticker");if(i.length>0){var r=this._createCustomStickerCategory(i);this._addCategories([r],!1,!0)}}},{key:"loadExternal",value:function(e){var t=this;return new p.a(e).load().then(function(e){t._addCategories(e.categories,t._options.replaceCategories)})}},{key:"_addCategories",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._categories=t?e.slice(0):n?this._mergeCategories(e,this._categories):this._mergeCategories(this._categories,e),this._updateCategoriesMap(),this._updateAllCategory()}},{key:"_mergeCategories",value:function(e,t){e=u.v.cloneCategories(e,"stickers");var n=!0,i=!1,r=void 0;try{for(var o,s=l()(t);!(n=(o=s.next()).done);n=!0){var c=o.value,f=!1,p=!0,d=!1,h=void 0;try{for(var _,m=l()(e);!(p=(_=m.next()).done);p=!0){var g=_.value;if(c.identifier===g.identifier){var y=!0,v=!1,b=void 0;try{for(var k,w=l()(c.stickers);!(y=(k=w.next()).done);y=!0){var S=k.value,C=!1,E=!0,x=!1,T=void 0;try{for(var O,R=l()(g.stickers);!(E=(O=R.next()).done);E=!0){var D=O.value;if(S.identifier===D.identifier){a()(D,S),C=!0;break}}}catch(e){x=!0,T=e}finally{try{!E&&R.return&&R.return()}finally{if(x)throw T}}C||g.stickers.push(S)}}catch(e){v=!0,b=e}finally{try{!y&&w.return&&w.return()}finally{if(v)throw b}}f=!0;break}}}catch(e){d=!0,h=e}finally{try{!p&&m.return&&m.return()}finally{if(d)throw h}}f||e.push(c)}}catch(e){i=!0,r=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw r}}return e}},{key:"_updateCategoriesMap",value:function(){var e=this;this._categoriesById={},this._categories.forEach(function(t){e._categoriesById[t.identifier]=t}),this._categories.forEach(function(t){t.stickers.forEach(function(t){e._stickersById[t.identifier]=t})}),void 0!==this._options.availableStickers&&null!==this._options.availableStickers&&(this._categories.forEach(function(t){"imgly_sticker_custom"!==t.identifier&&(t.stickers=t.stickers.filter(function(t){return-1!==e._options.availableStickers.indexOf(t.identifier)}))}),this._categories=this._categories.filter(function(e){return e.stickers.length>0})),this._updateAllCategory()}},{key:"_updateAllCategory",value:function(){this._allCategory={identifier:"all",defaultName:"All",stickers:this._categories.map(function(e){return e.stickers}).reduce(function(e,t){return e.concat(t)},[])},this._categoriesById.all=this._allCategory}},{key:"renderStickerThumbnailFromImage",value:function(e){var t=this._customStickerCanvas,n=t.getContext("2d");n.save();var i=62/e.width,r=i*e.height;t.width=62,t.height=62,n.clearRect(0,0,e.width,e.height),n.translate(0,.5*(t.height-r)),n.scale(i,i),n.drawImage(e,0,0);var o=t.toDataURL("image/png");return n.restore(),{data:o,width:62,height:r}}},{key:"addCustomStickerFromImage",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",r="data:image/svg"===e.src.substring(0,14),o=function(e,t){var n=e.x/e.y;return n>1?new u.w(t,t/n):new u.w(t*n,t)}(new u.w(e.width,e.height),2048),a=r?o:function(){var t=n._ui.getEditor().getSDK().getRenderer(),i=new u.w(e.width,e.height),r=1e6*n._ui.getEditor().getMaxMegapixels(),o=t.getMaxDimensions(),a=i.x*i.y>r,s=null!==o&&(i.x>o||i.y>o);if(a){var l=e.width/e.height,c=e.height/e.width;o=new u.w(Math.sqrt(r*l),Math.sqrt(r*c)).floor().max()}var f=i.clone();return(a||s)&&(i.x/i.y>1?(f.x=o,f.y=o/i.x*i.y):(f.x=o/i.y*i.x,f.y=o)),f}(),s=this._customStickerCanvas,l=s.getContext("2d");l.save();var f=this.renderStickerThumbnailFromImage(e);r?(e.width>e.height?(s.width=2048,s.height=2048/e.width*e.height):(s.height=2048,s.width=2048/e.height*e.width),e.width=s.width,e.height=s.height):(s.width=a.x,s.height=a.y,l.scale(a.x/e.width,a.y/e.height)),l.drawImage(e,0,0,e.width,e.height);var p=s.toDataURL();l.restore();var d={identifier:c.Utils.generateUUID(),defaultName:t||"",tintMode:i,images:{mediaThumb:{uris:[f.data],rawData:!0,width:f.width,height:f.height},mediaBase:{uris:r?[p,e.src]:[p],rawData:!0,isSVG:r,width:a.x,height:a.y}}},h=this._dynamicAssetsLibrary;h.addAsset("sticker",d,!0);var _=h.getAssets("sticker");if(1===_.length){var m=this._createCustomStickerCategory(_);this._addCategories([m],!1,!0)}else this.getCategory("imgly_sticker_custom").stickers=_,this._updateAllCategory();this._updateCategoriesMap()}},{key:"_createCustomStickerCategory",value:function(e){return{identifier:"imgly_sticker_custom",defaultName:"Custom",metaData:{backgroundImage:e[e.length-1].images.mediaBase.uris[0],rawData:!0},stickers:e}}},{key:"getStickersForCategory",value:function(e){if(!this._categoriesById[e])throw new Error("Unknown sticker category '"+e+"'");return this._categoriesById[e].stickers}},{key:"getStickerByIdentifier",value:function(e){return this._stickersById[e]}},{key:"getCategories",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?[this._allCategory].concat(this._categories):this._categories}},{key:"getCategory",value:function(e){return this._categoriesById[e]}}],[{key:"getURLForSticker",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"base",n=e.images,i="base"===t&&n.mediaBase||n.mediaThumb,r=i.uris||[i.uri];if(void 0===u.v.Browser||u.v.Browser.getIEVersion()){var o=r.filter(function(e){return!/\.svg$/i.test(e)});return o.length?o[0]:r[0]}var a=r.filter(function(e){return/\.svg$/i.test(e)});return a.length?a[0]:r[0]}}]),e}();t.a=_},function(e,t,n){"use strict";function i(e,t,n){return t in e?a()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r,o=n(0),a=n.n(o),s=n(4).q.Engine.Filters.OverlayFilter;t.a=(i(r={},s.BLEND_MODES.NORMAL,"normal"),i(r,s.BLEND_MODES.OVERLAY,"overlay"),i(r,s.BLEND_MODES.HARD_LIGHT,"hard light"),i(r,s.BLEND_MODES.SOFT_LIGHT,"soft light"),i(r,s.BLEND_MODES.MULTIPLY,"multiply"),i(r,s.BLEND_MODES.DARKEN,"darken"),i(r,s.BLEND_MODES.LIGHTEN,"lighten"),i(r,s.BLEND_MODES.SCREEN,"screen"),i(r,s.BLEND_MODES.COLOR_BURN,"color burn"),r)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onSharedStateUpdate"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),h(t,[{key:"componentDidMount",value:function(){_(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this.context.sharedState&&this.context.sharedState.on("update",this._onSharedStateUpdate)}},{key:"componentWillUnmount",value:function(){_(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),this.context.sharedState&&this.context.sharedState.off("update",this._onSharedStateUpdate)}},{key:"_onSharedStateUpdate",value:function(e,t){this.shouldSharedComponentUpdate(e,t)?(this.sharedComponentWillUpdate(e,t),this.forceUpdate(),this.sharedStateDidChange(e,t)):this.sharedStateDidChange(e,t)}},{key:"sharedComponentWillUpdate",value:function(e,t){}},{key:"shouldSharedComponentUpdate",value:function(e,t){return!0}},{key:"sharedStateDidChange",value:function(e,t){}},{key:"sharedStateWillChange",value:function(e,t){}},{key:"setSharedState",value:function(e,t){this.context.sharedState.set(e,t)}},{key:"getSharedState",value:function(e){return this.context.sharedState.get(e)}},{key:"forceSharedUpdate",value:function(){this.context.sharedState.broadcastUpdate()}},{key:"sharedState",get:function(){return this.context.sharedState.state}}]),t}();m.contextTypes={editor:d.k.object,ui:d.k.object,options:d.k.object,mediator:d.k.object,sharedState:d.k.object,theme:d.k.object,screen:d.k.object,appComponent:d.k.object,globalState:d.k.object},m.propTypes={sharedState:d.k.any},t.a=m},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(86),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKeyDown","_onInputBlur","_onInputChange"),o.state={},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),d(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.value!==e.value||this.props.disabled!==e.disabled}},{key:"_onInputChange",value:function(e){this.props.onLiveChange&&this.props.onLiveChange(e)}},{key:"_onInputBlur",value:function(e){this.props.onChange&&this.props.onChange(e)}},{key:"_onKeyDown",value:function(e){13!==e.keyCode&&27!==e.keyCode||this._input.blur(),this.props.onKeyDown&&this.props.onKeyDown()}},{key:"focus",value:function(){this._input.focus()}},{key:"_getInputStyle",value:function(){return{}}},{key:"render",value:function(){var e=this,t=this.constructor.RootElement;return f.m.createElement(t,{value:this.props.value,onChange:this._onInputChange,onBlur:this._onInputBlur,innerRef:function(t){e._input=t},onKeyDown:this._onKeyDown,name:this.props.name,styles:this.props.styles,className:this.props.className,style:this._getInputStyle(),disabled:this.props.disabled})}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h,h.RootElement=Object(f.x)(p.a).input("120drhm","NumericInputComponent")},function(e,t,n){"use strict";function i(e,t,n){return t in e?s()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(9),o=n.n(r),a=n(0),s=n.n(a),l=n(6),c=n.n(l),u=n(2),f=n.n(u),p=n(3),d=n.n(p),h=n(1),_=n.n(h),m=n(7),g=(n.n(m),n(5)),y=(n.n(g),n(342)),v=n(344),b=n(345),k=n(346),w=o.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},S=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),C=m.Math.Vector2,E=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||_()(t)).call.apply(e,[this].concat(o)));return s._bindAll("_onZoomDone","_onWindowResize","_onHistoryChange","_onAfterTransform"),s._events=(i(n={},g.Constants.EVENTS.ZOOM_DONE,s._onZoomDone),i(n,g.Constants.EVENTS.WINDOW_RESIZE,s._onWindowResize),i(n,g.Constants.EVENTS.HISTORY_UNDO,s._onHistoryChange),i(n,g.Constants.EVENTS.HISTORY_REDO,s._onHistoryChange),n),s.state=m.Utils.extend(s.state,{visible:!1,canvasClickDisabled:!1}),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=d()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(f.a?f()(e,t):e.__proto__=t)}(t,g.CanvasControlsComponent),S(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=c()(t,n);if(void 0===r){var o=_()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||_()(t.prototype),"componentDidMount",this).call(this),this.forceUpdate()}},{key:"_onAfterTransform",value:function(e){var t="sprite-transform-"+e.getId();this.props.controls.addLocalHistorySnapshot(t,!0)}},{key:"_onSpriteScale",value:function(e){this.props.controls.saveSpriteOptions&&this.props.controls.saveSpriteOptions()}},{key:"_onHistoryChange",value:function(){var e=this.getSharedState("operation");if(e){var t=this.getSharedState("selectedSprite");-1===e.getSprites().indexOf(t)&&this._selectNextSprite()}}},{key:"_onWindowResize",value:function(){var e=this;this.context.editor.once("rendered",function(){e.forceUpdate()})}},{key:"_onZoomDone",value:function(){this.context.editor.render(),this.setState({visible:!0})}},{key:"_onItemBlur",value:function(){}},{key:"_onCanvasClick",value:function(e){if(!this.state.canvasClickDisabled){var t=this.getSharedState("selectedSprite"),n=this._performHitTest(g.Utils.getEventPosition(e)),i=this.getSharedState("selectedSprite");n?t!==i&&(this.props.controls.saveSpriteOptions&&this.props.controls.saveSpriteOptions(),this.context.screen.refreshControlsComponent()):(i&&this._onItemBlur(),this.context.mediator.emit(g.Constants.EVENTS.SPRITES_DESELECTED),this.props.controls.saveSpriteOptions&&this.props.controls.saveSpriteOptions(),this.setSharedState({selectedSprite:null}))}}},{key:"_onSpriteDelete",value:function(e){this.getSharedState("operation").removeSprite(e),e.dispose(),this._selectNextSprite(),this.props.controls.addLocalHistorySnapshot("sprite-deletion",!1),this.context.editor.render()}},{key:"_onSpriteTakeToFront",value:function(e){this.getSharedState("operation").takeSpriteToFront(e),this.props.controls.addLocalHistorySnapshot("sprite-order",!1),this.forceUpdate(),this.context.editor.render()}},{key:"_onSpriteMaskCanvas",value:function(e){var t=this.context.editor;e?(e.setInverted(!e.getInverted()),this.props.controls.addLocalHistorySnapshot("inverted-layout"),t.render()):this.sharedState.set({textAsMask:!this.sharedState.get("textAsMask")})}},{key:"_onSpriteFlipHorizontally",value:function(e,t){t.stopPropagation(),e.setFlipHorizontally(!e.getFlipHorizontally()),this.props.controls.addLocalHistorySnapshot("sprite-flip-horizontally",!1),this.forceUpdate(),this.context.editor.render()}},{key:"_onSpriteDuplicate",value:function(e,t){t.stopPropagation();var n=this.getSharedState("operation"),i=e.serializeOptions();delete i.id,delete i.type,e.hasOption("image")&&(i.image=e.getImage());var r=n.getInputDimensions();i.position.add(new C(10,10).divide(r));var o=this._createSprite(i);this.setSharedState({selectedSprite:o}),n.addSprite(o),this.props.controls.addLocalHistorySnapshot("sprite-creation",!1),this.context.editor.render()}},{key:"_selectNextSprite",value:function(){var e=this.getSharedState("operation").getSprites(),t=e[e.length-1];t?(this.setSharedState({selectedSprite:t}),this.context.screen.refreshControlsComponent()):(this.props.controls.skipHistory=!0,this.context.mediator.emit(g.Constants.EVENTS.SPRITES_DESELECTED))}},{key:"_getComponentTypeForSprite",value:function(e){var t=m.Operations.SpriteOperation;switch(e.constructor){case t.StickerSprite:return y.a;case t.TextSprite:return v.a;case t.BrushSprite:return b.a;case t.TextDesignSprite:return k.a}}},{key:"_getPropsForSprite",value:function(e){return{hideContent:!0,isTextMaskingInverted:e.getInverted&&e.getInverted()}}},{key:"_renderSpriteItems",value:function(e){var t=this,n=this.getSharedState("selectedSprite");return e.map(function(e){var i=t._getComponentTypeForSprite(e),r=t._getPropsForSprite(e),o=n===e;return g.React.createElement(i,w({sprite:e,selected:o,onClick:t._onCanvasClick,onAfterChange:t._onAfterTransform.bind(t,e),onCanvasClickDisabled:t._onCanvasClickDisabled,onCanvasClickEnabled:t._onCanvasClickEnabled,onDelete:t._onSpriteDelete.bind(t,e),onTakeToFront:t._onSpriteTakeToFront.bind(t,e),onMaskCanvas:t._onSpriteMaskCanvas.bind(t,e),onFlipHorizontally:t._onSpriteFlipHorizontally.bind(t,e),onDuplicate:t._onSpriteDuplicate.bind(t,e),onScale:t._onSpriteScale.bind(t,e),canvasControls:t,key:e.getId()},r))})}},{key:"_renderOverlayControls",value:function(){return null}},{key:"_renderControls",value:function(){var e=this;if(this.state.visible){var t=this.getSharedState("operation").getSprites(),n=this._container&&this._getContainerStyle();return g.React.createElement(x,{className:void 0},g.React.createElement(T,{innerRef:function(t){e._innerContainer=t},style:n,className:void 0},!this.state.canvasClickDisabled&&g.React.createElement(O,{onClick:this._onCanvasClick}),g.React.createElement("div",null,this._renderSpriteItems(t),this._renderOverlayControls())))}}}]),t}();E.contextTypes=g.CanvasControlsComponent.contextTypes,t.a=E;var x=g.adonis.div("120drhm","CanvasControls"),T=g.adonis.div("1anj0of","Container"),O=g.adonis.div("o35414","ClickHandlerForInternetExplorer")},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return a()(e)}function r(e,t,n){return t in e?u()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(20),a=n.n(o),s=n(9),l=n.n(s),c=n(0),u=n.n(c),f=n(2),p=n.n(f),d=n(3),h=n.n(d),_=n(1),m=n.n(_),g=n(7),y=(n.n(g),n(5)),v=(n.n(y),n(343)),b=(n(80),l.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}),k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),u()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=g.Math.Vector2,S=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||m()(t)).call.apply(e,[this].concat(i)));return o.CONTROLS_MARGIN=0,o._bindAll("_onDragStart","_onDrag","_onDragStop","_onKeyboardMove","_onKeyboardDelete","_onRotateDragStart","_onRotateDrag","_onRotateDragStop","_onCornerDrag","_onCornerDragStop","_onPaddingAdjustmentArrowMouseDown","_onPaddingAdjustmentArrowDrag","_onPaddingAdjustmentArrowMouseUp","_onSpriteUpdate","_onTakeToFront","_onMaskCanvas","_onFlipHorizontally","_onDuplicate","_onDelete"),o._activeHorizontalGuides=[],o._activeVerticalGuides=[],o._activeRotationalGuides=[],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(p.a?p()(e,t):e.__proto__=t)}(t,y.BaseComponent),k(t,[{key:"componentDidMount",value:function(){this.props.sprite.on("update",this._onSpriteUpdate)}},{key:"componentWillUnmount",value:function(){this.props.sprite.off("update",this._onSpriteUpdate)}},{key:"componentWillReceiveProps",value:function(e){this.props.sprite.off("update",this._onSpriteUpdate),e.sprite.on("update",this._onSpriteUpdate)}},{key:"_onSpriteUpdate",value:function(){this.forceUpdate()}},{key:"_onTakeToFront",value:function(e){e.stopPropagation(),this.props.onTakeToFront&&this.props.onTakeToFront(e)}},{key:"_onMaskCanvas",value:function(e){e.stopPropagation(),this.props.onMaskCanvas&&this.props.onMaskCanvas(e)}},{key:"_onFlipHorizontally",value:function(e){e.stopPropagation(),this.props.onFlipHorizontally&&this.props.onFlipHorizontally(e)}},{key:"_onDelete",value:function(e){e.stopPropagation(),this.props.onDelete&&this.props.onDelete(e)}},{key:"_onDuplicate",value:function(e){e.stopPropagation(),this.props.onDuplicate&&this.props.onDuplicate(e)}},{key:"_onBeforeScale",value:function(){}},{key:"_onScale",value:function(e){}},{key:"_onRotateDragStart",value:function(){this._imageBoundingBox=this.props.canvasControls.getImageBoundingRect(),this._containerOffset=this.props.canvasControls.getContainerOffset(),this.props.onBeforeChange&&this.props.onBeforeChange(),this.props.onCanvasClickDisabled&&this.props.onCanvasClickDisabled()}},{key:"_onRotateDrag",value:function(e,t){var n=this.props.sprite,i=this.context.editor,r=this._getAbsoluteSpritePosition().add(this._imageBoundingBox.x,this._imageBoundingBox.y).clone(),o=t.clone().subtract(this._containerOffset).subtract(r),a=Math.atan2(o.y,o.x)-Math.PI/2;a=(a+2*Math.PI)%(2*Math.PI);var s=i.getSnappingOptions().rotation;if(s.enabled){var l=s.guides,c=s.threshold,u=o.len(),f=l.map(function(e){return e.getValue()}).sort(function(e,t){return e-t}),p=v.a.calcSnapThresholdInRadians(u,c);if(!this._rotationOffset){var d=v.a.mapToSnapSystem(this.props.sprite.getRotation(),f,p,!1);this._rotationOffset=d-a}a=v.a.mapFromSnapSystem(a+this._rotationOffset,f,p,!1),this._activeRotationalGuides=l.filter(function(e){return e.getValue()===a})}n.setRotation(a),this.context.editor.render(),this._spriteBoundingBoxSize=this._getSpriteBoundingBox(),this.forceUpdate()}},{key:"_onRotateDragStop",value:function(){this.props.onAfterChange&&this.props.onAfterChange(),this.props.onCanvasClickEnabled&&this.props.onCanvasClickEnabled(),this._activeRotationalGuides=[],this._rotationOffset=null,this.forceUpdate()}},{key:"_onKeyboardMove",value:function(e){var t=this.context.editor,n=t.getOutputDimensions(),i=this.props.sprite.getPosition().add(e.divide(n)).clone();this.props.sprite.setPosition(i),t.render(),this.forceUpdate()}},{key:"_onKeyboardDelete",value:function(e){e.preventDefault(),e.stopPropagation(),this._onDelete(e)}},{key:"_onCornerDragStart",value:function(e,t,n,i){var r=this.context.editor,o=this.props.sprite,a=o.getDimensions(r.getSDK(),r.getOutputDimensions()),s=a.x,l=a.y,c=new w(this.CONTROLS_MARGIN,this.CONTROLS_MARGIN);this._imageBoundingBox=this.props.canvasControls.getImageBoundingRect(),this._containerOffset=this.props.canvasControls.getContainerOffset().subtract(c);var u=o.getPivot(),f=o.getAnchor(),p=this._getAbsoluteSpritePosition().add(this._imageBoundingBox.x,this._imageBoundingBox.y),d=o.getDimensions(r.getSDK(),r.getOutputDimensions()),h=new w(d.width,d.height),_=p.clone().subtract(h.clone().multiply(f)).add(h.clone().multiply(u)).round(),m=i.clone().subtract(this._containerOffset).subtract(_);this._initialScaleSettings={width:s,height:l,mouseDistanceFromPivot:m},this._onBeforeScale(),this.props.onBeforeChange&&this.props.onBeforeChange(),this.props.onCanvasClickDisabled&&this.props.onCanvasClickDisabled()}},{key:"_onCornerDrag",value:function(e){var t=this.context.editor,n=this.props.sprite.getRotation(),i=this._initialScaleSettings,r=i.width,o=i.height,a=i.mouseDistanceFromPivot.clone().add(e),s=Math.cos(n),l=Math.sin(n),c=Math.max(Math.abs(a.x*s*2+a.y*l*2),this.constructor.MIN_WIDTH),u=Math.max(Math.abs(a.x*-l*2+a.y*s*2),this.constructor.MIN_WIDTH),f=new w(c/r,u/o);t.render(),this._onScale(f),this.props.onScale&&this.props.onScale()}},{key:"_onCornerDragStop",value:function(){this.props.onAfterChange&&this.props.onAfterChange(),this.props.onCanvasClickEnabled&&this.props.onCanvasClickEnabled()}},{key:"_onPaddingAdjustmentArrowMouseDown",value:function(e,t){var n=this;e.preventDefault(),e.stopPropagation(),this._initialDragPaddingMousePos=new w(e.pageX,e.pageY),"left"===t?this._initialDragPaddingMousePos.x+=this._getPaddingArrowsPos():"right"===t&&(this._initialDragPaddingMousePos.x+=-1*this._getPaddingArrowsPos()),this._handlePaddingAdjustmentArrowDrag=function(e){return n._onPaddingAdjustmentArrowDrag(e,t)},this.context.options.container.addEventListener("mousemove",this._handlePaddingAdjustmentArrowDrag),this.context.options.container.addEventListener("mouseup",this._onPaddingAdjustmentArrowMouseUp)}},{key:"_onPaddingAdjustmentArrowDrag",value:function(e,n){var i=this.props.sprite,r=this.context.editor,o=t.PADDING_MULTIPLIER,a=new w(e.pageX,e.pageY),s=i.getRotation(),l=Math.cos(s),c=Math.sin(s),u="left"===n?-1:1,f=new w(u*l,u*c),p=a.clone().subtract(this._initialDragPaddingMousePos),d=f.clone().multiply(f.clone().dot(p.clone())/Math.sqrt(f.len(),2)),h=d.x*f.x>=0&&d.y*f.y>=0,_=Math.sqrt(Math.pow(d.x,2)+Math.pow(d.y,2)),m=h?_:0,y=r.getOutputDimensions(),v=Math.min(y.x,y.y),b=i.getDimensions(),k=b.x,S=b.y,C=Math.sqrt(Math.pow(k,2)+Math.pow(S,2))/Math.min(k,S),E=Math.max(m/v,0)/i.getWidth()*o;E=g.Utils.clamp(E,t.PADDING_MIN_VALUE,C),this.props.sprite.setPadding(E),this.context.editor.render()}},{key:"_onPaddingAdjustmentArrowMouseUp",value:function(e){this._initialDragPaddingMousePos=null,this.context.options.container.removeEventListener("mousemove",this._handlePaddingAdjustmentArrowDrag),this.context.options.container.removeEventListener("mouseup",this._onPaddingAdjustmentArrowMouseUp)}},{key:"_getPaddingArrowsPos",value:function(){var e=t.PADDING_MIN_VALUE,n=t.PADDING_MULTIPLIER,i=this.props.sprite.getPadding(),r=this.context.editor.getOutputDimensions(),o=Math.min(r.x,r.y);return i*this.props.sprite.getWidth()/n*o-e}},{key:"_isDraggingDisabled",value:function(){return!this.props.selected}},{key:"_onDragStart",value:function(){var e=this.context.editor.getSnappingOptions().position,t=e.horizontalGuides,n=e.verticalGuides,i=e.enabled,r=e.threshold;if(i){var o=this._getSpritePos(),a=o.x,s=o.y,l=this._getSpriteBoundingBox(),c=l.x,u=l.y,f=v.a.mapSnappingGuidesToCenter(t||[],u),p=v.a.mapSnappingGuidesToCenter(n||[],c),d=f.map(function(e){return e.getValue()}).sort(function(e,t){return e-t}),h=p.map(function(e){return e.getValue()}).sort(function(e,t){return e-t}),_=v.a.mapToSnapSystem(a,h,r,!0),m=v.a.mapToSnapSystem(s,d,r,!0);this._initialPosition=new w(_,m)}else this._initialPosition=this._getSpritePos();this.props.onBeforeChange&&this.props.onBeforeChange()}},{key:"_onDrag",value:function(e){var t=this.context.editor,n=t.getOutputDimensions(),i=this._initialPosition.clone().add(e.divide(n));this._dragEndPosition=i.clone(),this._spriteBoundingBoxSize=this._getSpriteBoundingBox(),this.setSpritePos(i),t.render(),this.forceUpdate()}},{key:"_onDragStop",value:function(){this._activeVerticalGuides=[],this._activeHorizontalGuides=[],this.forceUpdate(),this._dragEndPosition&&0!==this._dragEndPosition.clone().subtract(this._initialPosition).len()&&this.props.onAfterChange&&this.props.onAfterChange()}},{key:"_getSpriteBoundingBox",value:function(e){var n=this.context.editor.getOutputDimensions(),i=this.props.sprite,r=e?e.clone().multiply(n):this._getAbsoluteSpritePosition(),o=r.x,a=r.y,s=this._getSpriteDimensions().divide(2),l=s.x,c=s.y,u=i.getRotation(),f=t._getRotatedCornerPos(o,a,o-l,a-c,u),p=t._getRotatedCornerPos(o,a,o+l,a-c,u),d=t._getRotatedCornerPos(o,a,o-l,a+c,u),h=t._getRotatedCornerPos(o,a,o+l,a+c,u),_=Math.min(f.x,p.x,d.x,h.x),m=Math.min(f.y,p.y,d.y,h.y),g=Math.max(f.x,p.x,d.x,h.x),y=Math.max(f.y,p.y,d.y,h.y);return new w((g-_)/n.x,(y-m)/n.y)}},{key:"_getAbsoluteSpritePosition",value:function(){var e=this.context.editor.getOutputDimensions();return this._getSpritePos().multiply(e)}},{key:"_getSpritePos",value:function(){return this.props.sprite.getPosition().clone()}},{key:"setSpritePos",value:function(e){var t=this.context.editor.getSnappingOptions();t.position.enabled?this.props.sprite.setPosition(this._getSnappedSpritePosition(e,t.position)):(this._activeHorizontalGuides=[],this._activeVerticalGuides=[],this.props.sprite.setPosition(e))}},{key:"_getSnappedSpritePosition",value:function(e,t){var n=this,i=e.x,r=e.y,o=this._getSpriteBoundingBox(),a=o.x,s=o.y,l=v.a.mapSnappingGuidesToCenter(t.horizontalGuides,s),c=v.a.mapSnappingGuidesToCenter(t.verticalGuides,a),u=l.map(function(e){return e.getValue()}).sort(),f=c.map(function(e){return e.getValue()}).sort(),p=t.threshold,d=v.a.mapFromSnapSystem(i,f,p,!0),h=v.a.mapFromSnapSystem(r,u,p,!0);return this._activeHorizontalGuides=[],this._activeVerticalGuides=[],l.forEach(function(e){var t=e.getOriginalGuide()||e;e.getValue()===h&&n._activeHorizontalGuides.push(t)}),c.forEach(function(e){var t=e.getOriginalGuide()||e;e.getValue()===d&&n._activeVerticalGuides.push(t)}),new w(d,h)}},{key:"_getContainerStyle",value:function(){return{}}},{key:"_renderControls",value:function(){var e=this,t=[];if(["top","bottom"].forEach(function(n){["left","right"].forEach(function(i){var o=n+"-"+i,a=r({},o,!0);t.push(y.React.createElement(y.DraggableComponent,{key:o,onStart:e._onCornerDragStart.bind(e,n,i),onDrag:e._onCornerDrag,onStop:e._onCornerDragStop},y.React.createElement(A,a)))})}),this.props.sprite.canAdjustPadding()&&this.props.sprite.getInverted()){var n=this._getPaddingArrowsPos();t.push(y.React.createElement(T,{key:"masking-padding-arrow-left",onMouseDown:function(t){return e._onPaddingAdjustmentArrowMouseDown(t,"left")},style:{transform:"translate("+-n+"px, -50%)",backgroundImage:"url('"+this._getAssetPath("editor/controls/shared/arrow-left.png",!0)+"')"}})),t.push(y.React.createElement(O,{key:"masking-padding-arrow-right",onMouseDown:function(t){return e._onPaddingAdjustmentArrowMouseDown(t,"right")},style:{transform:"translate("+n+"px, -50%)",backgroundImage:"url('"+this._getAssetPath("editor/controls/shared/arrow-right.png",!0)+"')"}}))}return t}},{key:"_getSpriteDimensions",value:function(){var e=this.context.editor,t=this.props.sprite,n=e.getOutputDimensions();return t.getDimensions(e.getSDK(),n).clone()}},{key:"_getOverlayPosition",value:function(){var e=this.context.editor,t=this.props.sprite,n=e.getOutputDimensions(),i=this._getSpriteDimensions(),r=this._getSpritePos().multiply(n),o=t.getRotation(),a=Math.sin(o),s=Math.cos(o),l=new w(Math.abs(i.x*s)+Math.abs(i.y*a),Math.abs(i.x*a)+Math.abs(i.y*s));return new w(r.x,r.y-l.y/2-70).clamp(new w(80,20),n.clone().subtract(80,70))}},{key:"_renderOverlayControls",value:function(){if(this.props.selected)return y.React.createElement(y.CanvasOverlayControlsComponent,b({},this.props,{takeToFront:this.props.sprite.canBeTakenToFront(),flipHorizontally:this.props.sprite.canBeFlippedHorizontally(),duplicate:this.props.sprite.canBeDuplicated(),maskCanvas:this.props.sprite.canMaskCanvas(),delete:this.props.sprite.canBeDeleted(),position:this._getOverlayPosition(),onTakeToFront:this._onTakeToFront,onMaskCanvas:this._onMaskCanvas,onFlipHorizontally:this._onFlipHorizontally,onDuplicate:this._onDuplicate,onDelete:this._onDelete}))}},{key:"_getItemControlsProps",value:function(){return{}}},{key:"_renderSnappingGuides",value:function(){var e=this,t=function(e,t){var n=t?"top":"left";return{key:"snapping-guide-"+n+"-"+e.getValue(),horizontal:t,vertical:!t,style:r({},n,100*e.getValue()+"%")}},n=this._activeHorizontalGuides,o=this._activeVerticalGuides,a=this._activeRotationalGuides,s=n.map(function(e){var n=t(e,!0);return y.React.createElement(M,n)}),l=o.map(function(e){var n=t(e,!1);return y.React.createElement(M,n)}),c=a.map(function(t){var n=function(t){var n=e._getSpritePos();return{key:"snapping-guide-rotation-"+t.getValue(),rotational:!0,style:{left:100*n.x+"%",top:100*n.y+"%",transform:"rotate("+t.getValue()+"rad)"}}}(t);return y.React.createElement(M,n)});return[].concat(i(s),i(l),i(c))}},{key:"_renderControlsContent",value:function(){return[this._renderControls(),y.React.createElement(D,{key:"rotateControls"},y.React.createElement(y.DraggableComponent,{onStart:this._onRotateDragStart,onDrag:this._onRotateDrag,onStop:this._onRotateDragStop},y.React.createElement(P,null)))]}},{key:"render",value:function(){var e=this,t=this.props,n=t.selected,i=t.sprite,r=this.state.editing,o=!r,a=this.context.editor.getOptions().editor.enableKeyboardControls,s=this._renderControlsContent(),l=this._getItemControlsProps(),c=y.React.createElement(x,b({style:this._getContainerStyle()},l),s);return y.React.createElement(y.CanvasDraggableComponent,{enableShortcuts:a,onStart:this._onDragStart,onStop:this._onDragStop,onKeyboardMove:this._onKeyboardMove,onKeyboardDelete:this._onKeyboardDelete,onDrag:this._onDrag,disabled:this._isDraggingDisabled()},y.React.createElement(C,{onClick:this.props.onClick,"data-type":i.constructor.type,"data-selected":n,className:void 0},this._renderOverlayControls(),this._renderSnappingGuides(),y.React.createElement(E,{style:this._getContainerStyle(),editing:n&&r,innerRef:function(t){e._container=t},className:void 0},y.React.createElement(R,null,this._renderContent()),n&&!o&&s),n&&o&&c))}}],[{key:"_getRotatedCornerPos",value:function(e,t,n,i,r){var o=n-e,a=i-t,s=Math.sqrt(o*o+a*a);return r+=Math.atan2(a,o),{x:e+s*Math.cos(r),y:t+s*Math.sin(r)}}}]),t}();S.contextTypes=y.BaseComponent.contextTypes,S.MIN_WIDTH=1,S.PADDING_MULTIPLIER=4,S.PADDING_MIN_VALUE=.01,t.a=S;var C=y.adonis.div("ygnw89","OuterContainer"),E=y.adonis.div("bkf7u8",{editing:"64zghi"},"Container"),x=y.adonis.div("36haff","ItemControls"),T=y.adonis.div("1wn24iy","PaddingAdjustmentArrowLeft"),O=Object(y.adonis)(T)("1md0hz0","PaddingAdjustmentArrowRight"),R=y.adonis.div("120drhm","Content"),D=y.adonis.div("77tiy3","RotateControl"),I=y.adonis.div("mznefm","Knob"),P=Object(y.adonis)(I)("18w0qe3","RotateKnob"),A=Object(y.adonis)(I)("wzcqy",{"top-left":"1dtvxe8","top-right":"1tu191k","bottom-left":"1we5ut6","bottom-right":"f2wva1"},"CornerKnob"),M=y.adonis.div("1khi7fo",{horizontal:"1qfe7jn",vertical:"1q2afaf",rotational:"mx9yp5"},"SnappingGuideComponent")},function(e,t,n){"use strict";var i=n(7),r=(n.n(i),i.Engine.Filters.OverlayFilter);t.a={normal:r.BLEND_MODES.NORMAL,overlay:r.BLEND_MODES.OVERLAY,hardLight:r.BLEND_MODES.HARD_LIGHT,softLight:r.BLEND_MODES.SOFT_LIGHT,multiply:r.BLEND_MODES.MULTIPLY,darken:r.BLEND_MODES.DARKEN,lighten:r.BLEND_MODES.LIGHTEN,screen:r.BLEND_MODES.SCREEN,colorBurn:r.BLEND_MODES.COLOR_BURN}},function(e,t,n){var i=n(17),r=n(12).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,n){var i=n(17);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var i=n(35),r=n(34),o=n(19),a=n(62),s=n(23),l=n(90),c=Object.getOwnPropertyDescriptor;t.f=n(18)?c:function(e,t){if(e=o(e),t=a(t,!0),l)try{return c(e,t)}catch(e){}if(s(e,t))return r(!i.f.call(e,t),e[t])}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,n){var i=n(14),r=n(161),o=n(70),a=n(68)("IE_PROTO"),s=function(){},l=function(){var e,t=n(61)("iframe"),i=o.length;for(t.style.display="none",n(93).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),l=e.F;i--;)delete l.prototype[o[i]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=i(e),n=new s,s.prototype=null,n[a]=e):n=l(),void 0===t?n:r(n,t)}},function(e,t,n){var i=n(67),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t,n){var i=n(69)("keys"),r=n(47);e.exports=function(e){return i[e]||(i[e]=r(e))}},function(e,t,n){var i=n(10),r=n(12),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:n(37)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var i=n(36),r=n(13)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),r))?n:o?i(t):"Object"==(a=i(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var i=n(71),r=n(13)("iterator"),o=n(31);e.exports=n(10).getIteratorMethod=function(e){if(void 0!=e)return e[r]||e["@@iterator"]||o[i(e)]}},function(e,t,n){var i,r,o,a=n(27),s=n(180),l=n(93),c=n(61),u=n(12),f=u.process,p=u.setImmediate,d=u.clearImmediate,h=u.MessageChannel,_=u.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},v=function(e){y.call(e.data)};p&&d||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},i(m),m},d=function(e){delete g[e]},"process"==n(36)(f)?i=function(e){f.nextTick(a(y,e,1))}:_&&_.now?i=function(e){_.now(a(y,e,1))}:h?(o=(r=new h).port2,r.port1.onmessage=v,i=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(i=function(e){u.postMessage(e+"","*")},u.addEventListener("message",v,!1)):i="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:p,clear:d}},function(e,t,n){"use strict";var i=n(46);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i}),this.resolve=i(t),this.reject=i(n)}(e)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){t.f=n(13)},function(e,t,n){var i=n(12),r=n(10),o=n(37),a=n(76),s=n(16).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(79),a=(r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e})({},o.a,{LOAD:"load",SAVE:"save",EDITOR_RESIZE:"editor:resize",ZOOM:"editor:zoom",ZOOM_CHANGED:"editor:zoom_changed",HISTORY_REDO:"history:redo",HISTORY_BEFORE_REDO:"history:before-redo",TEXT_SCALED:"editor:text:scaled",TRANSFORM_RESIZE:"transform:resize",TRANSFORM_AFTER_EDIT:"transform:after-edit",ADDED_STICKER:"sticker:added-sticker",SPRITES_DESELECTED:"editor:sprite:deselected-all",CANVAS_FOCUS:"canvas:focus"});t.a=a},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var i=n(222),r={EXPORT:"export",CLOSE:"close",OPERATION_CREATED:"operation:created",OPERATION_UPDATED:"operation:updated",OPERATION_REMOVED:"operation:removed",EDITOR_READY:"editor:ready",WINDOW_RESIZE:"window:resize",ZOOM_DONE:"editor:zoom_done",HISTORY_UNDO:"history:undo",HISTORY_UPDATED:"history:update",FEATURES_DISABLED:"editor:features:disabled",FEATURES_ENABLED:"editor:features:enabled",FEATURES_UPDATED:"editor:features:updated",TRANSFORM_REAPPLY_RATIO:"transform:reapply_ratio"};t.b={DEFAULTS:{ART_FILTERS:i.a,FILTERS:[{identifier:"imgly_filters_duotone",defaultName:"DuoTone",assetFileName:"duotone",filters:[{identifier:"imgly_duotone_desert",defaultName:"Desert",lightColor:"#e1de9a",darkColor:"#cb2129"},{identifier:"imgly_duotone_peach",defaultName:"Peach",lightColor:"#e9abb8",darkColor:"#0040ff"},{identifier:"imgly_duotone_clash",defaultName:"Clash",lightColor:"#f41a0f",darkColor:"#23007c"},{identifier:"imgly_duotone_plum",defaultName:"Plum",lightColor:"#74d7ff",darkColor:"#23007c"},{identifier:"imgly_duotone_breezy",defaultName:"Breezy",lightColor:"#68fdff",darkColor:"#c20000"},{identifier:"imgly_duotone_deepblue",defaultName:"Deep Blue",lightColor:"#2de9eb",darkColor:"#58007c"},{identifier:"imgly_duotone_frog",defaultName:"Frog",lightColor:"#5bff60",darkColor:"#7f23a9"},{identifier:"imgly_duotone_sunset",defaultName:"Sunset",lightColor:"#f8ea46",darkColor:"#c400be"}]},{identifier:"imgly_filters_bw",assetFileName:"b&w",defaultName:"Black & White",filters:[{identifier:"imgly_lut_ad1920",defaultName:"1920 A.D.",lutImage:"filters/imgly_lut_ad1920_5_5_128.png"},{identifier:"imgly_lut_bw",defaultName:"Greyed",lutImage:"filters/imgly_lut_bw_5_5_128.png"},{identifier:"imgly_lut_x400",defaultName:"Dusty",lutImage:"filters/imgly_lut_dusty_5_5_128.png"},{identifier:"imgly_lut_litho",defaultName:"Litho",lutImage:"filters/imgly_lut_litho_5_5_128.png"},{identifier:"imgly_lut_sepiahigh",defaultName:"Sepia",lutImage:"filters/imgly_lut_sepia_5_5_128.png"},{identifier:"imgly_lut_plate",defaultName:"Weathered",lutImage:"filters/imgly_lut_weathered_5_5_128.png"},{identifier:"imgly_lut_sin",defaultName:"Hard Stuff",lutImage:"filters/imgly_lut_hard_stuff_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8}]},{identifier:"imgly_filters_retro",assetFileName:"vintage",defaultName:"Vintage",filters:[{identifier:"imgly_lut_blues",defaultName:"Polaroid",lutImage:"filters/imgly_lut_polaroid_5_5_128.png"},{identifier:"imgly_lut_front",defaultName:"Sunny 70s",lutImage:"filters/imgly_lut_sunny_70s_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_texas",defaultName:"Oldtimer",lutImage:"filters/imgly_lut_oldtimer_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_celsius",defaultName:"Inferno",lutImage:"filters/imgly_lut_inferno_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_cool",defaultName:"Snappy",lutImage:"filters/imgly_lut_snappy_5_5_128.png"}]},{identifier:"imgly_filters_analog",assetFileName:"smooth",defaultName:"Smooth",filters:[{identifier:"imgly_lut_chest",defaultName:"Chestnut",lutImage:"filters/imgly_lut_chestnut_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_winter",defaultName:"Softly",lutImage:"filters/imgly_lut_softly_5_5_128.png"},{identifier:"imgly_lut_kdynamic",defaultName:"Pebble",lutImage:"filters/imgly_lut_pebble_5_5_128.png"},{identifier:"imgly_lut_fall",defaultName:"Moss",lutImage:"filters/imgly_lut_moss_5_5_128.png"},{identifier:"imgly_lut_lenin",defaultName:"Lemon",lutImage:"filters/imgly_lut_lemon_5_5_128.png"},{identifier:"imgly_lut_pola669",defaultName:"Green Gap",lutImage:"filters/imgly_lut_green_gap_5_5_128.png"}]},{identifier:"imgly_filters_winter",assetFileName:"cold",defaultName:"Cold",filters:[{identifier:"imgly_lut_elder",defaultName:"Colla",lutImage:"filters/imgly_lut_colla_5_5_128.png"},{identifier:"imgly_lut_orchid",defaultName:"Solanus",lutImage:"filters/imgly_lut_solanus_5_5_128.png"},{identifier:"imgly_lut_bleached",defaultName:"Kalmen",lutImage:"filters/imgly_lut_kalmen_5_5_128.png"},{identifier:"imgly_lut_bleachedblue",defaultName:"Joran",lutImage:"filters/imgly_lut_joran_5_5_128.png"},{identifier:"imgly_lut_breeze",defaultName:"Levante",lutImage:"filters/imgly_lut_levante_5_5_128.png"},{identifier:"imgly_lut_blueshadows",defaultName:"Zephyr",lutImage:"filters/imgly_lut_zephyr_5_5_128.png"}]},{identifier:"imgly_filters_summer",assetFileName:"warm",defaultName:"Warm",filters:[{identifier:"imgly_lut_sunset",defaultName:"Golden",lutImage:"filters/imgly_lut_golden_5_5_128.png"},{identifier:"imgly_lut_eighties",defaultName:"Low Fire",lutImage:"filters/imgly_lut_low_fire_5_5_128.png"},{identifier:"imgly_lut_evening",defaultName:"Sunrise",lutImage:"filters/imgly_lut_sunrise_5_5_128.png"},{identifier:"imgly_lut_k2",defaultName:"Flat Black",lutImage:"filters/imgly_lut_flat_black_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_nogreen",defaultName:"Pumpkin",lutImage:"filters/imgly_lut_pumpkin_5_5_128.png"}]},{identifier:"imgly_filters_legacy",defaultName:"Legacy",assetFileName:"legacy",filters:[{identifier:"imgly_lut_ancient",defaultName:"Ancient",lutImage:"filters/imgly_lut_ancient_5_5_128.png"},{identifier:"imgly_lut_cottoncandy",defaultName:"Candy",lutImage:"filters/imgly_lut_cottoncandy_5_5_128.png"},{identifier:"imgly_lut_classic",defaultName:"Classic",lutImage:"filters/imgly_lut_classic_5_5_128.png"},{identifier:"imgly_lut_colorful",defaultName:"Colorful",lutImage:"filters/imgly_lut_colorful_5_5_128.png"},{identifier:"imgly_lut_creamy",defaultName:"Creamy",lutImage:"filters/imgly_lut_creamy_5_5_128.png"},{identifier:"imgly_lut_fixie",defaultName:"Fixie",lutImage:"filters/imgly_lut_fixie_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_food",defaultName:"Food",lutImage:"filters/imgly_lut_food_5_5_128.png"},{identifier:"imgly_lut_fridge",defaultName:"Fridge",lutImage:"filters/imgly_lut_fridge_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_glam",defaultName:"Glam",lutImage:"filters/imgly_lut_glam_5_5_128.png"},{identifier:"imgly_lut_gobblin",defaultName:"Gobblin",lutImage:"filters/imgly_lut_gobblin_5_5_128.png"},{identifier:"imgly_lut_highcontrast",defaultName:"Hicon",lutImage:"filters/imgly_lut_highcontrast_5_5_128.png"},{identifier:"imgly_lut_highcarb",defaultName:"High Carb",lutImage:"filters/imgly_lut_highcarb_5_5_128.png"},{identifier:"imgly_lut_k1",defaultName:"K1",lutImage:"filters/imgly_lut_k1_5_5_128.png"},{identifier:"imgly_lut_k6",defaultName:"K6",lutImage:"filters/imgly_lut_k6_5_5_128.png"},{identifier:"imgly_lut_keen",defaultName:"Keen",lutImage:"filters/imgly_lut_keen_5_5_128.png"},{identifier:"imgly_lut_lomo",defaultName:"Lomo",lutImage:"filters/imgly_lut_lomo_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_lomo100",defaultName:"Lomo 100",lutImage:"filters/imgly_lut_lomo100_5_5_128.png"},{identifier:"imgly_lut_lucid",defaultName:"Lucid",lutImage:"filters/imgly_lut_lucid_5_5_128.png"},{identifier:"imgly_lut_mellow",defaultName:"Mellow",lutImage:"filters/imgly_lut_mellow_8_8_512.png",resolution:512,horizontalTileCount:8,verticalTileCount:8},{identifier:"imgly_lut_neat",defaultName:"Neat",lutImage:"filters/imgly_lut_neat_5_5_128.png"},{identifier:"imgly_lut_pale",defaultName:"Pale",lutImage:"filters/imgly_lut_pale_5_5_128.png"},{identifier:"imgly_lut_pitched",defaultName:"Pitched",lutImage:"filters/imgly_lut_pitched_5_5_128.png"},{identifier:"imgly_lut_polasx",defaultName:"Pola SX",lutImage:"filters/imgly_lut_polasx_5_5_128.png"},{identifier:"imgly_lut_pro400",defaultName:"Pro 400",lutImage:"filters/imgly_lut_pro400_5_5_128.png"},{identifier:"imgly_lut_quozi",defaultName:"Quozi",lutImage:"filters/imgly_lut_quozi_5_5_128.png"},{identifier:"imgly_lut_settled",defaultName:"Settled",lutImage:"filters/imgly_lut_settled_5_5_128.png"},{identifier:"imgly_lut_seventies",defaultName:"Seventies",lutImage:"filters/imgly_lut_seventies_5_5_128.png"},{identifier:"imgly_lut_soft",defaultName:"Soft",lutImage:"filters/imgly_lut_soft_5_5_128.png"},{identifier:"imgly_lut_steel",defaultName:"Steel",lutImage:"filters/imgly_lut_steel_5_5_128.png"},{identifier:"imgly_lut_summer",defaultName:"Summer",lutImage:"filters/imgly_lut_summer_5_5_128.png"},{identifier:"imgly_lut_tender",defaultName:"Tender",lutImage:"filters/imgly_lut_tender_5_5_128.png"},{identifier:"imgly_lut_twilight",defaultName:"Twilight",lutImage:"filters/imgly_lut_twilight_5_5_128.png"}]}],OVERLAYS:[{identifier:"imgly_overlay_golden",defaultName:"Golden",image:"overlays/imgly_overlay_golden.jpg",thumbnail:"overlays/imgly_overlay_golden_thumb.jpg",blendMode:"lighten"},{identifier:"imgly_overlay_bokeh",defaultName:"Bokeh",image:"overlays/imgly_overlay_bokeh.jpg",thumbnail:"overlays/imgly_overlay_bokeh_thumb.jpg",blendMode:"lighten"},{identifier:"imgly_overlay_hearts",defaultName:"Hearts",image:"overlays/imgly_overlay_hearts.jpg",thumbnail:"overlays/imgly_overlay_hearts_thumb.jpg",blendMode:"screen"},{identifier:"imgly_overlay_lightleak1",defaultName:"Light Leak",image:"overlays/imgly_overlay_lightleak1.jpg",thumbnail:"overlays/imgly_overlay_lightleak1_thumb.jpg",blendMode:"screen"},{identifier:"imgly_overlay_lightleak2",defaultName:"Light Leak 2",image:"overlays/imgly_overlay_lightleak2.jpg",thumbnail:"overlays/imgly_overlay_lightleak2_thumb.jpg",blendMode:"lighten"},{identifier:"imgly_overlay_rain",defaultName:"Rain",image:"overlays/imgly_overlay_rain.jpg",thumbnail:"overlays/imgly_overlay_rain_thumb.jpg",blendMode:"overlay"},{identifier:"imgly_overlay_wood",defaultName:"Wood",image:"overlays/imgly_overlay_wood.jpg",thumbnail:"overlays/imgly_overlay_wood_thumb.jpg",blendMode:"multiply"},{identifier:"imgly_overlay_mosaic",defaultName:"Mosaic",image:"overlays/imgly_overlay_mosaic.jpg",thumbnail:"overlays/imgly_overlay_mosaic_thumb.jpg",blendMode:"multiply"},{identifier:"imgly_overlay_chop",defaultName:"Chop",image:"overlays/imgly_overlay_chop.jpg",thumbnail:"overlays/imgly_overlay_chop_thumb.jpg",blendMode:"multiply"},{identifier:"imgly_overlay_vintage",defaultName:"Vintage",image:"overlays/imgly_overlay_vintage.jpg",thumbnail:"overlays/imgly_overlay_vintage_thumb.jpg",blendMode:"darken"},{identifier:"imgly_overlay_metal",defaultName:"Metal",image:"overlays/imgly_overlay_metal.jpg",thumbnail:"overlays/imgly_overlay_metal_thumb.jpg",blendMode:"overlay"},{identifier:"imgly_overlay_paper",defaultName:"Paper",image:"overlays/imgly_overlay_paper.jpg",thumbnail:"overlays/imgly_overlay_paper_thumb.jpg",blendMode:"multiply"},{identifier:"imgly_overlay_painting",defaultName:"Painting",image:"overlays/imgly_overlay_painting.jpg",thumbnail:"overlays/imgly_overlay_painting_thumb.jpg",blendMode:"overlay"},{identifier:"imgly_overlay_grain",defaultName:"Grain",image:"overlays/imgly_overlay_grain.jpg",thumbnail:"overlays/imgly_overlay_grain_thumb.jpg",blendMode:"overlay"},{identifier:"imgly_overlay_clouds",defaultName:"Clouds",image:"overlays/imgly_overlay_clouds.jpg",thumbnail:"overlays/imgly_overlay_clouds_thumb.jpg",blendMode:"softLight"},{identifier:"imgly_overlay_wall1",defaultName:"Wall",image:"overlays/imgly_overlay_wall1.jpg",thumbnail:"overlays/imgly_overlay_wall1_thumb.jpg",blendMode:"lighten"},{identifier:"imgly_overlay_wall2",defaultName:"Wall 2",image:"overlays/imgly_overlay_wall2.jpg",thumbnail:"overlays/imgly_overlay_wall2_thumb.jpg",blendMode:"overlay"}],FRAME_CATEGORIES:[{identifier:"imgly_frame_generic",defaultName:"Generic",metaData:{backgroundImage:"frames/generic.png"},frames:[{identifier:"imgly_frame_dia",defaultName:"Dia",layoutMode:"horizontal-inside",thumbnail:"frames/imgly_frame_dia/imgly_frame_dia_thumb.png",imageGroups:{top:{mid:{image:"frames/imgly_frame_dia/imgly_frame_dia_top.png",mode:"repeat"}},left:{start:"frames/imgly_frame_dia/imgly_frame_dia_top_corner_left.png",mid:"frames/imgly_frame_dia/imgly_frame_dia_left.png",end:"frames/imgly_frame_dia/imgly_frame_dia_bottom_corner_left.png"},right:{start:"frames/imgly_frame_dia/imgly_frame_dia_top_corner_right.png",mid:"frames/imgly_frame_dia/imgly_frame_dia_right.png",end:"frames/imgly_frame_dia/imgly_frame_dia_bottom_corner_right.png"},bottom:{mid:{image:"frames/imgly_frame_dia/imgly_frame_dia_bottom.png",mode:"repeat"}}}},{identifier:"imgly_frame_art_decor",defaultName:"Art Decor",tintable:!0,layoutMode:"horizontal-inside",thumbnail:"frames/imgly_frame_art_decor/imgly_frame_art_decor_thumb.png",imageGroups:{top:{start:"frames/imgly_frame_art_decor/imgly_frame_art_decor_top_corner_left.png",mid:{image:"frames/imgly_frame_art_decor/imgly_frame_art_decor_top.png",mode:"stretch"},end:"frames/imgly_frame_art_decor/imgly_frame_art_decor_top_corner_right.png"},left:{mid:{image:"frames/imgly_frame_art_decor/imgly_frame_art_decor_left.png",mode:"stretch"}},right:{mid:{image:"frames/imgly_frame_art_decor/imgly_frame_art_decor_right.png",mode:"stretch"}},bottom:{start:"frames/imgly_frame_art_decor/imgly_frame_art_decor_bottom_corner_left.png",mid:{image:"frames/imgly_frame_art_decor/imgly_frame_art_decor_bottom.png",mode:"stretch"},end:"frames/imgly_frame_art_decor/imgly_frame_art_decor_bottom_corner_right.png"}}},{identifier:"imgly_frame_black_passepartout",defaultName:"Black Passepartout",layoutMode:"horizontal-inside",thumbnail:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_thumb.png",imageGroups:{top:{start:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_top_corner_left.png",mid:{image:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_top.png",mode:"stretch"},end:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_top_corner_right.png"},left:{mid:{image:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_left.png",mode:"stretch"}},right:{mid:{image:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_right.png",mode:"stretch"}},bottom:{start:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_bottom_corner_left.png",mid:{image:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_bottom.png",mode:"stretch"},end:"frames/imgly_frame_black_passepartout/imgly_frame_black_passepartout_bottom_corner_right.png"}}},{identifier:"imgly_frame_lowpoly_shadow",defaultName:"Low Poly",layoutMode:"horizontal-inside",thumbnail:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_thumb.png",imageGroups:{top:{start:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_top_corner_left.png",mid:{image:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_top.png",mode:"stretch"},end:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_top_corner_right.png"},left:{mid:{image:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_left.png",mode:"stretch"}},right:{mid:{image:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_right.png",mode:"stretch"}},bottom:{start:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_bottom_corner_left.png",mid:{image:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_bottom.png",mode:"stretch"},end:"frames/imgly_frame_lowpoly_shadow/imgly_frame_lowpoly_shadow_bottom_corner_right.png"}}},{identifier:"imgly_frame_wood_passepartout",defaultName:"Wood Passepartout",layoutMode:"horizontal-inside",thumbnail:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_thumb.png",imageGroups:{top:{start:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_top_corner_left.png",mid:{image:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_top.png",mode:"stretch"},end:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_top_corner_right.png"},left:{mid:{image:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_left.png",mode:"stretch"}},right:{mid:{image:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_right.png",mode:"stretch"}},bottom:{start:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_bottom_corner_left.png",mid:{image:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_bottom.png",mode:"stretch"},end:"frames/imgly_frame_wood_passepartout/imgly_frame_wood_passepartout_bottom_corner_right.png"}}}]}],STICKER_CATEGORIES:[{identifier:"imgly_sticker_emoticons",defaultName:"Emoticons",metaData:{backgroundImage:"stickers/emoticons/background.png"},stickers:[{identifier:"imgly_sticker_emoticons_alien",defaultName:"Alien",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_alien.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_alien.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_alien.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_alien.png"],width:1e3,height:935}}},{identifier:"imgly_sticker_emoticons_angel",defaultName:"Angel",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_angel.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_angel.png"],width:62,height:64},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_angel.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_angel.png"]}}},{identifier:"imgly_sticker_emoticons_angry",defaultName:"Angry",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_angry.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_angry.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_angry.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_angry.png"]}}},{identifier:"imgly_sticker_emoticons_anxious",defaultName:"Anxious",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_anxious.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_anxious.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_anxious.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_anxious.png"]}}},{identifier:"imgly_sticker_emoticons_asleep",defaultName:"Asleep",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_asleep.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_asleep.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_asleep.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_asleep.png"]}}},{identifier:"imgly_sticker_emoticons_attention",defaultName:"Attention",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_attention.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_attention.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_attention.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_attention.png"]}}},{identifier:"imgly_sticker_emoticons_baby_chicken",defaultName:"Baby Chicken",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_baby_chicken.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_baby_chicken.png"],width:61,height:42},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_baby_chicken.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_baby_chicken.png"]}}},{identifier:"imgly_sticker_emoticons_batman",defaultName:"Batman",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_batman.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_batman.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_batman.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_batman.png"]}}},{identifier:"imgly_sticker_emoticons_beer",defaultName:"Beer",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_beer.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_beer.png"],width:62,height:59},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_beer.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_beer.png"]}}},{identifier:"imgly_sticker_emoticons_blush",defaultName:"Blush",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_blush.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_blush.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_blush.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_blush.png"]}}},{identifier:"imgly_sticker_emoticons_boxer",defaultName:"Boxer",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_boxer.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_boxer.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_boxer.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_boxer.png"]}}},{identifier:"imgly_sticker_emoticons_business",defaultName:"Business",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_business.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_business.png"],width:60,height:63},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_business.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_business.png"]}}},{identifier:"imgly_sticker_emoticons_chicken",defaultName:"Chicken",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_chicken.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_chicken.png"],width:63,height:55},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_chicken.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_chicken.png"]}}},{identifier:"imgly_sticker_emoticons_cool",defaultName:"Cool",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_cool.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_cool.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_cool.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_cool.png"]}}},{identifier:"imgly_sticker_emoticons_cry",defaultName:"Cry",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_cry.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_cry.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_cry.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_cry.png"]}}},{identifier:"imgly_sticker_emoticons_deceased",defaultName:"Deceased",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_deceased.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_deceased.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_deceased.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_deceased.png"]}}},{identifier:"imgly_sticker_emoticons_devil",defaultName:"Devil",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_devil.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_devil.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_devil.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_devil.png"]}}},{identifier:"imgly_sticker_emoticons_duckface",defaultName:"Duckface",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_duckface.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_duckface.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_duckface.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_duckface.png"]}}},{identifier:"imgly_sticker_emoticons_furious",defaultName:"Furious",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_furious.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_furious.png"],width:62,height:61},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_furious.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_furious.png"]}}},{identifier:"imgly_sticker_emoticons_grin",defaultName:"Grin",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_grin.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_grin.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_grin.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_grin.png"]}}},{identifier:"imgly_sticker_emoticons_guitar",defaultName:"Guitar",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_guitar.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_guitar.png"],width:64,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_guitar.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_guitar.png"]}}},{identifier:"imgly_sticker_emoticons_harry_potter",defaultName:"Harry Potter",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_harry_potter.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_harry_potter.png"],width:64,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_harry_potter.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_harry_potter.png"]}}},{identifier:"imgly_sticker_emoticons_hippie",defaultName:"Hippie",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_hippie.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_hippie.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_hippie.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_hippie.png"]}}},{identifier:"imgly_sticker_emoticons_hitman",defaultName:"Hitman",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_hitman.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_hitman.png"],width:64,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_hitman.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_hitman.png"]}}},{identifier:"imgly_sticker_emoticons_humourous",defaultName:"Humourous",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_humourous.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_humourous.png"],width:64,height:64},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_humourous.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_humourous.png"]}}},{identifier:"imgly_sticker_emoticons_idea",defaultName:"Idea",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_idea.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_idea.png"],width:64,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_idea.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_idea.png"]}}},{identifier:"imgly_sticker_emoticons_impatient",defaultName:"Impatient",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_impatient.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_impatient.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_impatient.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_impatient.png"]}}},{identifier:"imgly_sticker_emoticons_kiss",defaultName:"Kiss",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_kiss.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_kiss.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_kiss.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_kiss.png"]}}},{identifier:"imgly_sticker_emoticons_kisses",defaultName:"Kisses",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_kisses.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_kisses.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_kisses.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_kisses.png"]}}},{identifier:"imgly_sticker_emoticons_laugh",defaultName:"Laugh",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_laugh.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_laugh.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_laugh.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_laugh.png"]}}},{identifier:"imgly_sticker_emoticons_loud_cry",defaultName:"Loud Cry",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_loud_cry.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_loud_cry.png"],width:64,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_loud_cry.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_loud_cry.png"]}}},{identifier:"imgly_sticker_emoticons_loving",defaultName:"Loving",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_loving.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_loving.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_loving.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_loving.png"]}}},{identifier:"imgly_sticker_emoticons_masked",defaultName:"Masked",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_masked.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_masked.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_masked.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_masked.png"]}}},{identifier:"imgly_sticker_emoticons_music",defaultName:"Music",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_music.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_music.png"],width:62,height:54},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_music.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_music.png"]}}},{identifier:"imgly_sticker_emoticons_nerd",defaultName:"Nerd",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_nerd.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_nerd.png"]},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_nerd.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_nerd.png"]}}},{identifier:"imgly_sticker_emoticons_ninja",defaultName:"Ninja",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_ninja.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_ninja.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_ninja.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_ninja.png"]}}},{identifier:"imgly_sticker_emoticons_not_speaking_to_you",defaultName:"Not Speaking To You",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_not_speaking_to_you.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_not_speaking_to_you.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_not_speaking_to_you.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_not_speaking_to_you.png"]}}},{identifier:"imgly_sticker_emoticons_pig",defaultName:"Pig",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_pig.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_pig.png"],width:63,height:41},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_pig.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_pig.png"]}}},{identifier:"imgly_sticker_emoticons_pumpkin",defaultName:"Pumpkin",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_pumpkin.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_pumpkin.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_pumpkin.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_pumpkin.png"]}}},{identifier:"imgly_sticker_emoticons_question",defaultName:"Question",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_question.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_question.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_question.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_question.png"]}}},{identifier:"imgly_sticker_emoticons_rabbit",defaultName:"Rabbit",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_rabbit.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_rabbit.png"],width:65,height:47},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_rabbit.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_rabbit.png"]}}},{identifier:"imgly_sticker_emoticons_sad",defaultName:"Sad",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sad.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_sad.png"]},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sad.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_sad.png"]}}},{identifier:"imgly_sticker_emoticons_sick",defaultName:"Sick",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sick.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_sick.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sick.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_sick.png"]}}},{identifier:"imgly_sticker_emoticons_skateboard",defaultName:"Skateboard",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_skateboard.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_skateboard.png"],width:62,height:64},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_skateboard.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_skateboard.png"]}}},{identifier:"imgly_sticker_emoticons_skull",defaultName:"Skull",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_skull.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_skull.png"],width:62,height:62},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_skull.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_skull.png"]}}},{identifier:"imgly_sticker_emoticons_sleepy",defaultName:"Sleepy",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sleepy.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_sleepy.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sleepy.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_sleepy.png"]}}},{identifier:"imgly_sticker_emoticons_smile",defaultName:"Smile",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_smile.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_smile.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_smile.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_smile.png"]}}},{identifier:"imgly_sticker_emoticons_smoking",defaultName:"Smoking",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_smoking.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_smoking.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_smoking.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_smoking.png"]}}},{identifier:"imgly_sticker_emoticons_sobbing",defaultName:"Sobbing",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sobbing.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_sobbing.png"],width:62,height:59},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sobbing.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_sobbing.png"]}}},{identifier:"imgly_sticker_emoticons_star",defaultName:"Star",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_star.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_star.png"],width:64,height:64},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_star.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_star.png"]}}},{identifier:"imgly_sticker_emoticons_steaming_furious",defaultName:"Steaming Furious",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_steaming_furious.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_steaming_furious.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_steaming_furious.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_steaming_furious.png"]}}},{identifier:"imgly_sticker_emoticons_sunbathing",defaultName:"Sunbathing",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sunbathing.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_sunbathing.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_sunbathing.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_sunbathing.png"]}}},{identifier:"imgly_sticker_emoticons_tired",defaultName:"Tired",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_tired.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_tired.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_tired.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_tired.png"]}}},{identifier:"imgly_sticker_emoticons_tongue_out_wink",defaultName:"Tongue Out Wink",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_tongue_out_wink.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_tongue_out_wink.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_tongue_out_wink.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_tongue_out_wink.png"]}}},{identifier:"imgly_sticker_emoticons_wave",defaultName:"Wave",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wave.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_wave.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wave.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_wave.png"]}}},{identifier:"imgly_sticker_emoticons_wide_grin",defaultName:"Wide Grin",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wide_grin.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_wide_grin.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wide_grin.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_wide_grin.png"]}}},{identifier:"imgly_sticker_emoticons_wink",defaultName:"Wink",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wink.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_wink.png"],width:62,height:58},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wink.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_wink.png"]}}},{identifier:"imgly_sticker_emoticons_wrestler",defaultName:"Wrestler",images:{mediaThumb:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wrestler.svg","stickers/emoticons/stickers/thumbs/imgly_sticker_emoticons_wrestler.png"],width:62,height:60},mediaBase:{uris:["stickers/emoticons/stickers/imgly_sticker_emoticons_wrestler.svg","stickers/emoticons/stickers/base/imgly_sticker_emoticons_wrestler.png"]}}}]},{identifier:"imgly_sticker_shapes",defaultName:"Shapes",metaData:{backgroundImage:"stickers/shapes/background.png"},stickers:[{identifier:"imgly_sticker_shapes_arrow_02",defaultName:"Arrow 1",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_arrow_02.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_arrow_02.png"],width:2e3,height:1236},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_arrow_02.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_arrow_02.png"],width:2e3,height:1236}}},{identifier:"imgly_sticker_shapes_arrow_03",defaultName:"Arrow 2",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_arrow_03.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_arrow_03.png"],width:2e3,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_arrow_03.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_arrow_03.png"],width:2e3,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_01",defaultName:"Badge 1",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_01.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_01.png"],width:2e3,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_01.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_01.png"],width:2e3,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_04",defaultName:"Badge 2",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_04.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_04.png"],width:2e3,height:1589},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_04.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_04.png"],width:2e3,height:1589}}},{identifier:"imgly_sticker_shapes_badge_06",defaultName:"Badge 3",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_06.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_06.png"],width:2e3,height:1733},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_06.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_06.png"],width:2e3,height:1733}}},{identifier:"imgly_sticker_shapes_badge_08",defaultName:"Badge 4",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_08.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_08.png"],width:2e3,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_08.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_08.png"],width:2e3,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_11",defaultName:"Badge 5",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_11.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_11.png"],width:2e3,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_11.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_11.png"],width:2e3,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_12",defaultName:"Badge 6",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_12.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_12.png"],width:2001,height:1903},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_12.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_12.png"],width:2001,height:1903}}},{identifier:"imgly_sticker_shapes_badge_13",defaultName:"Badge 7",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_13.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_13.png"],width:2e3,height:1718},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_13.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_13.png"],width:2e3,height:1718}}},{identifier:"imgly_sticker_shapes_badge_15",defaultName:"Badge 8",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_15.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_15.png"],width:1618,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_15.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_15.png"],width:1618,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_18",defaultName:"Badge 9",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_18.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_18.png"],width:1198,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_18.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_18.png"],width:1198,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_19",defaultName:"Badge 10",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_19.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_19.png"],width:2127,height:481},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_19.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_19.png"],width:2127,height:481}}},{identifier:"imgly_sticker_shapes_badge_20",defaultName:"Badge 11",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_20.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_20.png"],width:2e3,height:1404},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_20.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_20.png"],width:2e3,height:1404}}},{identifier:"imgly_sticker_shapes_badge_28",defaultName:"Badge 12",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_28.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_28.png"],width:2e3,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_28.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_28.png"],width:2e3,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_32",defaultName:"Badge 13",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_32.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_32.png"],width:1960,height:2e3},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_32.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_32.png"],width:1960,height:2e3}}},{identifier:"imgly_sticker_shapes_badge_35",defaultName:"Badge 14",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_35.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_35.png"],width:2e3,height:2002},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_35.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_35.png"],width:2e3,height:2002}}},{identifier:"imgly_sticker_shapes_badge_36",defaultName:"Badge 15",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_36.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_badge_36.png"],width:2e3,height:1668},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_badge_36.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_badge_36.png"],width:2e3,height:1668}}},{identifier:"imgly_sticker_shapes_spray_01",defaultName:"Spray 1",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_01.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_spray_01.png"],width:1912,height:2039},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_01.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_spray_01.png"],width:1912,height:2039}}},{identifier:"imgly_sticker_shapes_spray_03",defaultName:"Spray 2",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_03.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_spray_03.png"],width:1681,height:1779},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_03.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_spray_03.png"],width:1681,height:1779}}},{identifier:"imgly_sticker_shapes_spray_04",defaultName:"Spray 3",tintMode:"solid",images:{mediaThumb:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_04.svg","stickers/shapes/stickers/thumbs/imgly_sticker_shapes_spray_04.png"],width:1407,height:2248},mediaBase:{uris:["stickers/shapes/stickers/imgly_sticker_shapes_spray_04.svg","stickers/shapes/stickers/base/imgly_sticker_shapes_spray_04.png"],width:1407,height:2248}}}]}]}}},function(e,t,n){"use strict";var i=n(250),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7);n.n(f);var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.Configurable),t}();p.Edge=r()({LEADING:"leading",CENTER:"center",TRAILING:"trailing"}),p.prototype.availableOptions={edges:{type:f.OptionType.ARRAY,required:!0},value:{type:f.OptionType.NUMBER,required:!0},originalGuide:{type:f.OptionType.OBJECT,required:!1}},t.a=p},function(e,t,n){"use strict";var i=n(41),r=n.n(i),o=n(42),a=n.n(o),s=n(0),l=n.n(s),c=n(8),u=n.n(c),f=n(257),p=n(260),d="function"==typeof a.a&&"symbol"==typeof r.a?function(e){return typeof e}:function(e){return e&&"function"==typeof a.a&&e.constructor===a.a&&e!==a.a.prototype?"symbol":typeof e},h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),l()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._fonts=n,this._loadedFonts=[]}return h(e,[{key:"setFonts",value:function(e){this._fonts=e}},{key:"needsToLoad",value:function(){for(var e=this,t=0;t<this._fonts.length;t++){var n=function(t){var n=void 0;return e._fonts[t].getVariations().forEach(function(e){n=n||e.getProvider()}),n?{v:!0}:"continue"}(t);switch(n){case"continue":continue;default:if("object"===(void 0===n?"undefined":d(n)))return n.v}}}},{key:"fontLoaded",value:function(e){var t=e.getFontFamily();return-1!==this._loadedFonts.indexOf(t)}},{key:"setFontLoaded",value:function(e){if(!this.fontLoaded(e)){var t=e.getFontFamily();this._loadedFonts.push(t)}}},{key:"load",value:function(){var e=this,t=this._fonts,n={google:new f.a(this._ui),file:new p.a(this._ui)},i=function(){for(var e in n)n[e].dispose()};t.filter(function(t){return!e.fontLoaded(t)}).forEach(function(e){e.getVariations().forEach(function(e){var t=e.getProvider();t&&n[t].add(e)})});var r=[];for(var o in n)r.push(n[o].load());return u.a.all(r).then(function(){i(),t.forEach(function(t){e.setFontLoaded(t)})}).catch(function(e){throw i(),e})}}]),e}();t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(122),h=n(55),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.a),_(t,[{key:"_serializeSticker",value:function(e,n){var i=e.getInputDimensions(!1),r=m(t.prototype.__proto__||p()(t.prototype),"_serializeSticker",this).call(this,e,n);return"none"!==n.getTintMode()&&(r.options.tintColor=n.serializeOption("tintColor",!0)),r.options.dimensions=n.getDimensions().clone().divide(i.min()).toObject(),r.options.identifier=r.options.name,delete r.options.name,r}},{key:"_serializePath",value:function(e){var n=m(t.prototype.__proto__||p()(t.prototype),"_serializePath",this).call(this,e),i=e.getBrush();return i.hasOption("hardness")&&(n.hardness=i.getOption("hardness")),n}},{key:"_serializeOperation",value:function(e,n){return"frame"===e.constructor.identifier?(this._serializeFrameOperation(e,n),null):"overlay"===e.constructor.identifier?(this._serializeOverlayOperation(e,n),null):m(t.prototype.__proto__||p()(t.prototype),"_serializeOperation",this).call(this,e,n)}},{key:"_serializeFrameOperation",value:function(e,t){var n=t.filter(function(e){return"sprite"===e.type}),i=void 0;n.length?i=n.pop():(i={type:"sprite",options:{sprites:[]}},t.push(i)),i.options.sprites.push({type:"frame",options:this._getFrameOptions(e)})}},{key:"_serializeOverlayOperation",value:function(e,t){if(e.getIdentifier()){var n=t.filter(function(e){return"sprite"===e.type}),i=void 0;n.length?i=n.pop():(i={type:"sprite",options:{sprites:[]}},t.push(i)),i.options.sprites.push({type:"overlay",options:{identifier:e.getIdentifier(),intensity:e.getAlpha(),blendMode:h.a[e.getBlendMode()]}})}}},{key:"_getFrameOptions",value:function(e){return{identifier:e.getFrame().identifier}}},{key:"_serializeOrientationOperation",value:function(e){var n=m(t.prototype.__proto__||p()(t.prototype),"_serializeOrientationOperation",this).call(this,e);return 90!==n.options.rotation&&270!==n.options.rotation||(n.options.flipHorizontally=!n.options.flipHorizontally,n.options.flipVertically=!n.options.flipVertically),n}},{key:"_serializeTransformOperation",value:function(e){var n=this._editor.operations;if(n.exists("orientation")){e=e.clone();var i=n.get("orientation");e.rotate(-i.getRotation()),i.getFlipVertically()&&(e.flip("vertical"),e.setRotation(-1*e.getRotation())),i.getFlipHorizontally()&&(e.flip("horizontal"),e.setRotation(-1*e.getRotation()))}var r=m(t.prototype.__proto__||p()(t.prototype),"_serializeTransformOperation",this).call(this,e);return r.type="transform",r}},{key:"_serializeText",value:function(e,n){var i=m(t.prototype.__proto__||p()(t.prototype),"_serializeText",this).call(this,e,n),r=e.getInputDimensions(!1);return i.options.fontIdentifier=n.getFontIdentifier(),i.options.maxWidth=i.options.maxWidth*r.x/r.min(),delete i.options.fontFamily,i}},{key:"_serializeFilterOperation",value:function(e){var n=m(t.prototype.__proto__||p()(t.prototype),"_serializeFilterOperation",this).call(this,e);return n?(n.options.identifier=n.options.name,delete n.options.name,n):null}},{key:"_serializeRadialFocusOperation",value:function(e){var n=m(t.prototype.__proto__||p()(t.prototype),"_serializeRadialFocusOperation",this).call(this,e),i=n.options.options;return i.start=i.position,delete i.position,i.end={x:i.start.x+i.radius,y:i.start.y},delete i.radius,n}}]),t}();t.a=g,g.version="2.0.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(123),g=n(124),y=n(125),v=n(54),b=n(126),k=n(81),w=n(25),S=n(55),C=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),E=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},x=_.r.flipObject(S.a),T=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._frameManager=new g.a(o._ui,o._getOptions("frame"));var a=o._getOptions("overlay");return a&&(o._overlayManager=new y.a(o._ui,a)),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,m.a),C(t,[{key:"_deserializeSprite",value:function(e,n){return"frame"===n.type?this._deserializeFrame(e,n):"overlay"===n.type?this._deserializeOverlay(e,n):E(t.prototype.__proto__||h()(t.prototype),"_deserializeSprite",this).call(this,e,n)}},{key:"_deserializeOperation",value:function(e){return"transform"===e.type?this._deserializeTransformOperation(e):E(t.prototype.__proto__||h()(t.prototype),"_deserializeOperation",this).call(this,e)}},{key:"_deserializeOrientationOperation",value:function(e){if(this._data.meta&&"html5"!==this._data.meta.platform)return E(t.prototype.__proto__||h()(t.prototype),"_deserializeOrientationOperation",this).call(this,e);var n=e.options,i=n.rotation,r=n.flipHorizontally,o=n.flipVertically,a=90===i&&!r&&!o;return a|=90===i&&r&&o,a|=270===i&&!r&&!o,(a|=270===i&&r&&o)&&(e.options.flipHorizontally=!e.options.flipHorizontally,e.options.flipVertically=!e.options.flipVertically),E(t.prototype.__proto__||h()(t.prototype),"_deserializeOrientationOperation",this).call(this,e)}},{key:"_deserializeTransformOperation",value:function(e){var n=this;return E(t.prototype.__proto__||h()(t.prototype),"_deserializeCropOperation",this).call(this,e).then(function(e){if(e){var t=_.r.Array.find(n._data.operations,function(e){return"orientation"===e.type});if(t){var i=t.options,r=i.rotation,o=i.flipHorizontally,a=i.flipVertically;90!==r&&270!==r||(!o&&a||o&&!a)&&(o=!o,a=!a),e.rotate(i.rotation),o&&(e.flip("horizontal"),e.setRotation(-1*e.getRotation())),a&&(e.flip("vertical"),e.setRotation(-1*e.getRotation()))}return e}})}},{key:"_deserializeFrame",value:function(e,t){var n=this,i=t.options.identifier,r=this._frameManager.getFrameByIdentifier(i);if(!r)return _.h.warn("Deserializer","Unknown frame `"+i+"`. Skipping frame."),p.a.resolve();var o=new b.a(this._ui,r);return o.load().then(function(){n._editor.operations.getOrCreate("frame",{frame:o.getFrame()})})}},{key:"_deserializeOverlay",value:function(e,t){var n=this,i=t.options,r=i.blendMode,o=i.intensity,a=i.identifier,s=this._overlayManager.getOverlayByIdentifier(a);if(!s)return _.h.warn("Deserializer","Unknown overlay `"+a+"`. Skipping overlay."),p.a.resolve();var l=this._editor.getUI().getAssetPath(s.image);return w.a.load(l).then(function(e){n._editor.operations.getOrCreate("overlay",{alpha:o,identifier:a,blendMode:parseInt(x[r||s.blendMode],10),image:e})})}},{key:"_createBrushForPath",value:function(e){var n=E(t.prototype.__proto__||h()(t.prototype),"_createBrushForPath",this).call(this,e);return void 0!==e.hardness&&n.hasOption("hardness")&&n.setHardness(e.hardness),n}},{key:"_deserializeSticker",value:function(e,t){var n=this,i=_.q.Operations.SpriteOperation,r=t.options,o=this._stickerManager.getStickerByIdentifier(r.identifier),a=v.a.getURLForSticker(o,"base");if(!o)return _.h.warn("Deserializer","Unknown sticker `"+r.identifier+"`. Skipping sprite."),p.a.resolve();var s=e.getInputDimensions(!1);return new p.a(function(t,l){var c=new window.Image;c.addEventListener("load",function(){var n=i.StickerSprite.prototype.availableOptions.adjustments.structure,a=r.rotation,l=r.flipHorizontally,u=r.flipVertically,f={identifier:r.identifier,image:c,position:_.w.fromObject(r.position),dimensions:_.w.fromObject(r.dimensions).multiply(s.min()),rotation:a,flipHorizontally:l,flipVertically:u,adjustments:{}};void 0!==r.adjustments&&["brightness","contrast","saturation"].forEach(function(e){void 0!==r.adjustments[e]&&(f.adjustments[e]=r.adjustments[e]+n[e].default)}),void 0!==r.tintColor&&void 0!==o.tintMode&&(f.tintColor=_.c.fromArray(r.tintColor),f.tintMode=o.tintMode),t(e.createSticker(f))}),c.crossOrigin=n._editor.getCrossOrigin(),c.src=n._editor.getUI().getAssetPath(a)})}},{key:"_deserializeFilterOperation",value:function(e){var t=this,n=e.options;return this._filterManager.getFilterByIdentifier(n.identifier)?this._filterManager.instantiateFilterWithIdentifier(n.identifier).then(function(e){var i=t._editor.operations.getOrCreate("filter");if(i)return i.set({identifier:n.identifier,filter:e,intensity:n.intensity}),i}):(_.h.warn("Deserializer","Unknown filter `"+n.identifier+"`"),p.a.resolve())}},{key:"_deserializeFocusOperation",value:function(e){var n=e.options,i=n.options;if("radial"!==n.type)return E(t.prototype.__proto__||h()(t.prototype),"_deserializeFocusOperation",this).call(this,e);var r=this._editor.getImage(),o=r.width/r.height,a=i.start,s=i.end,l=i.gradientRadius,c=i.blurRadius,u=_.w.fromObject(s).subtract(_.w.fromObject(a)).multiply(o,1).len();return p.a.resolve(this._editor.operations.getOrCreate("radial-focus",{position:_.w.fromObject(a),radius:u,gradientRadius:l,blurRadius:c}))}},{key:"_deserializeText",value:function(e,t){var n=t.options,i=n.fontSize,r=n.lineHeight,o=n.fontIdentifier,a=n.alignment,s=n.rotation,l=n.maxWidth,c=n.color,u=n.backgroundColor,f=new k.a(this._ui),p=this._fontManager.getVariationByIdentifier(o);return p?f.setFonts([p.getFont()]):p=this._fontManager.getDefaultFont(),f.load().then(function(){var t=e.getInputDimensions(!1),o=l*t.min()/t.x,f=e.createText({fontSize:i,lineHeight:r,fontFamily:p.getFontFamily(),fontWeight:p.getFontWeight(),fontIdentifier:p.getIdentifier(),alignment:a,rotation:s,maxWidth:o,text:n.text,color:_.c.fromArray(c),backgroundColor:_.c.fromArray(u),position:_.w.fromObject(n.position)});return f._edited=!0,f})}}]),t}();t.a=T,T.version="2.0.0"},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(6),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(4),_=n(78),m=n(56),g=n(283),y=n(21),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=function e(t,n,i){null===t&&(t=Function.prototype);var r=s()(t,n);if(void 0===r){var o=d()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},k=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||d()(t)).call.apply(e,[this].concat(o)));return s._needsStyleFixes=!0,s._bindAll("_onZoom","_onZoomDone","_onCanvasDrag","_onCanvasDragStart","_onCanvasDragStop","_onCanvasClick","_onCanvasClickDisabled","_onCanvasClickEnabled","_emitFocusEvent"),s._initialRerender=!0,s._events=(i(n={},h.d.EVENTS.ZOOM,s._onZoom),i(n,h.d.EVENTS.ZOOM_DONE,s._onZoomDone),n),s.state={canvasClickDisabled:!1,displayHeader:!0},s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}(t,m.a),v(t,[{key:"setSharedState",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];b(t.prototype.__proto__||d()(t.prototype),"setSharedState",this).call(this,e,n),i&&this.props.controls.updateSharedState()}},{key:"fixStyles",value:function(){if(h.v.Browser.isIElte(11)){var e=this._outerContainer.offsetHeight;this._container.style.height=e+"px"}}},{key:"componentDidMount",value:function(){b(t.prototype.__proto__||d()(t.prototype),"componentDidMount",this).call(this),this._initialRerender&&this.forceUpdate()}},{key:"_performHitTest",value:function(e){var t=this.context.appComponent.getBounds(),n=e.subtract(t.left,t.top),i=this.context.editor,r=i.controls.getAvailable();if(i.operations.get("sprite")){var o=this._getTopSpriteAtPosition(n);if(o){if(o.selectedSprite===this.getSharedState("selectedSprite"))return!0;var a=o.selectedSprite.serializeOptions().type;if(a){var s=r[a];if(s&&s.clickAtPosition(n,i))return this.context.screen.switchToControls(a,o,null,null,!0),!0}}}for(var l in r){var c=r[l].clickAtPosition(n,i);if(c)return c.selectedSprite===this.getSharedState("selectedSprite")||(this.context.screen.switchToControls(l,c,null,null,!0),!0)}return!1}},{key:"_getTopSpriteAtPosition",value:function(e){var t=this.context.editor,n=t.operations.get("sprite");if(!n)return!1;var i=n.getSpritesAtPosition(e,t.getOutputTextureDimensions());return!!i[0]&&{selectedSprite:i[0]}}},{key:"_onCanvasClickDisabled",value:function(){this.setState({canvasClickDisabled:!0})}},{key:"_onCanvasClickEnabled",value:function(){var e=this;Object(h.A)(function(){e.setState({canvasClickDisabled:!1})})}},{key:"_onCanvasClick",value:function(e){var t=h.v.getEventPosition(e);this._performHitTest(t)}},{key:"_onZoom",value:function(){this.forceUpdate()}},{key:"_onZoomDone",value:function(){this.forceUpdate()}},{key:"_onCanvasDragStart",value:function(){var e=this.context.editor;this._initialOffset=e.offset.clone()}},{key:"_onCanvasDrag",value:function(e){var t=this.context.editor,n=t.offset;t.offset=n.copy(this._initialOffset).add(e),t.render()}},{key:"_onCanvasDragStop",value:function(){this.forceUpdate()}},{key:"_emitFocusEvent",value:function(){this.context.mediator.emit(_.a.CANVAS_FOCUS)}},{key:"getImageBoundingRect",value:function(){var e=this.context.editor.getSDK(),t=e.getContainer(),n=e.getSprite(),i=t.getPosition();if(!n.getTexture())return new h.o;var r=e.getOutputDimensions(),o=this._outerContainer.getBoundingClientRect(),a=this.context.appComponent.getBounds();return new h.o(Math.floor(i.x-r.x/2-(o.left-a.left)),Math.floor(i.y-r.y/2-(o.top-a.top)),Math.ceil(r.x),Math.ceil(r.y))}},{key:"getContainerOffset",value:function(){var e=this._outerContainer.getBoundingClientRect();return new h.w(e.left,e.top)}},{key:"_getContainerStyle",value:function(){var e=this.getImageBoundingRect();return{left:e.x,top:e.y,width:e.width,height:e.height}}},{key:"_renderControls",value:function(){var e=this,t=this._imageContainer&&this._getContainerStyle();return h.m.createElement(w,{innerRef:function(t){e._imageContainer=t},style:t,onClick:this._onCanvasClick})}},{key:"render",value:function(){var e=this,t=this.context.editor;return h.m.createElement(S,{draggable:!t.isShallow&&t.isDraggable,className:void 0,innerRef:function(t){e._outerContainer=t},onClick:this._emitFocusEvent},h.m.createElement(y.a,{disabled:t.isShallow||!t.isDraggable,onStart:this._onCanvasDragStart,onDrag:this._onCanvasDrag,onStop:this._onCanvasDragStop},h.m.createElement("div",null,h.m.createElement(C,{innerRef:function(t){e._container=t}},this.state.displayHeader&&h.m.createElement(g.a,null),this._renderControls()))))}},{key:"container",get:function(){return this._container}}]),t}();k.contextTypes=m.a.contextTypes,k.propTypes={options:h.k.object},t.a=k;var w=h.x.div("55byom","Container"),S=h.x.div("1vszu45",{draggable:"ovipzq"},"CanvasControls"),C=h.x.div("1h6ank1","CanvasControlsContainer")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(21),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).call(this));return e.constructor.NATIVE_SCROLLBAR_WIDTH||(e.constructor.NATIVE_SCROLLBAR_WIDTH=d.v.getScrollbarWidth()),e._isDragging=!1,e._bindAll("_onButtonDragStart","_onButtonDrag","_onButtonDragStop","_onBarDragStart","_onBarDrag","_onBarDragStop","_onListScroll"),e.state={buttonSize:0,buttonPosition:0,buttonVisible:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),_(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this.update()}},{key:"_onListScroll",value:function(){if(!this._isDragging){var e=this._getDirection(),n=void 0,i=void 0,r=void 0;e===t.HORIZONTAL?(n=this._list.scrollWidth-this._list.offsetWidth,i=this._list.scrollLeft,r=this._root.offsetWidth-this.state.buttonSize):e===t.VERTICAL&&(n=this._list.scrollHeight-this._list.offsetHeight,i=this._list.scrollTop,r=this._root.offsetHeight-this.state.buttonSize);var o=r*(i/n)||0;this.setState({buttonPosition:o}),this.props.onScroll&&this.props.onScroll(i)}}},{key:"_onButtonDragStart",value:function(e){this._isDragging=!0,this._initialButtonPosition=this.state.buttonPosition||0}},{key:"_onButtonDrag",value:function(e){var n=this._getDirection(),i=void 0;n===t.HORIZONTAL?i=this._initialButtonPosition+e.x:n===t.VERTICAL&&(i=this._initialButtonPosition+e.y),this._setButtonPosition(i)}},{key:"_onButtonDragStop",value:function(){this._isDragging=!1}},{key:"_onBarDragStart",value:function(e){var n=d.v.getEventPosition(e);this._initialPosition=n.clone();var i=this._root.getBoundingClientRect(),r=new d.w(i.left,i.top),o=n.clone().subtract(r),a=this._getDirection();a===t.HORIZONTAL?this._setButtonPosition(o.x-this.state.buttonSize/2):a===t.VERTICAL&&this._setButtonPosition(o.y-this.state.buttonSize/2),document.addEventListener("mousemove",this._onBarDrag),document.addEventListener("touchmove",this._onBarDrag),document.addEventListener("mouseup",this._onBarDragStop),document.addEventListener("touchend",this._onBarDragStop)}},{key:"_onBarDrag",value:function(e){var n=d.v.getEventPosition(e),i=this._root.getBoundingClientRect(),r=new d.w(i.left,i.top),o=n.clone().subtract(r),a=this._getDirection();a===t.HORIZONTAL?this._setButtonPosition(o.x-this.state.buttonSize/2):a===t.VERTICAL&&this._setButtonPosition(o.y-this.state.buttonSize/2)}},{key:"_onBarDragStop",value:function(){document.removeEventListener("mousemove",this._onBarDrag),document.removeEventListener("touchmove",this._onBarDrag),document.removeEventListener("mouseup",this._onBarDragStop),document.removeEventListener("touchend",this._onBarDragStop)}},{key:"_setButtonPosition",value:function(e){var n=this._getDirection(),i=void 0,r=void 0;n===t.HORIZONTAL?(i=this._root.offsetWidth-this.state.buttonSize,r=this._list.scrollWidth-this._list.offsetWidth):n===t.VERTICAL&&(i=this._root.offsetHeight-this.state.buttonSize,r=this._list.scrollHeight-this._list.offsetHeight),e=Math.max(0,e),e=Math.min(e,i),this.setState({buttonPosition:e});var o=r*(e/i);n===t.HORIZONTAL?this._list.scrollLeft=o:n===t.VERTICAL&&(this._list.scrollTop=o),this.props.onScroll&&this.props.onScroll(o)}},{key:"_updateButtonSize",value:function(e){var n,i,r=void 0,o=void 0,a=this._getDirection();a===t.HORIZONTAL?(r=this._list.clientWidth,o=this._list.scrollWidth):a===t.VERTICAL&&(r=this._list.offsetHeight,o=this._list.scrollHeight),n=r/o*r,i=o>r,this.setState({buttonSize:n,buttonVisible:i},e)}},{key:"_updateListSize",value:function(){if(this._list){var e=this._getDirection();if(e===t.HORIZONTAL){this._list.style.height="";var n=this._getFullListDimensions();this._listSize=n.y}else if(e===t.VERTICAL){this._list.style.width="";var i=this._getFullListDimensions();this._listSize=i.x}}}},{key:"_getFullListDimensions",value:function(){var e=this._list.getBoundingClientRect();return new d.w(e.width,e.height)}},{key:"update",value:function(){var e=this;if(!d.v.isMobile()){if(d.v.Browser.isIElte(11)){var n=this._container.offsetHeight;this._list.style.height=n+"px"}var i=this._getDirection();this._updateButtonSize(function(){e._listSize||e._updateListSize();var n=e._listSize;e.state.buttonVisible&&(n+=e.constructor.NATIVE_SCROLLBAR_WIDTH),i===t.HORIZONTAL?(e._root.style.top=e._listSize-12+"px",e._root.style.width=e._list.offsetWidth+"px"):i===t.VERTICAL&&(e._list.style.width=n+"px",e._root.style.right=0,e._root.style.height=e._list.offsetHeight+"px")}),this._list.addEventListener("scroll",this._onListScroll),this._onListScroll()}}},{key:"setScrollPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!this._list)return!1;this._list.scrollTop=e}},{key:"_getDirection",value:function(){return this.props.direction||"horizontal"}},{key:"_getGradientOpacity",value:function(){if(!this._list)return!1;var e=void 0;return e=this._getDirection()===t.HORIZONTAL?this._list.scrollWidth-this._list.offsetWidth-this._list.scrollLeft:this._list.scrollHeight-this._list.offsetHeight-this._list.scrollTop,Math.min(Math.max(e/15,0),1)}},{key:"_getButtonStyle",value:function(){return"horizontal"===this._getDirection()?{right:this.state.buttonPosition,width:this.state.buttonSize}:{top:this.state.buttonPosition,right:0,height:this.state.buttonSize}}},{key:"getList",value:function(){return this.refs.list}},{key:"getRoot",value:function(){return this.refs.root}},{key:"_renderChild",value:function(e){var t=this;return d.m.cloneElement(e,{innerRef:function(n){e.props.innerRef&&e.props.innerRef(n),t._list=n}})}},{key:"render",value:function(){var e=this;if(d.v.isMobile())return this.props.children;var n=this._getButtonStyle(),i=this._renderChild(this.props.children),r=this._getDirection(),o=this._getGradientOpacity();return d.m.createElement(g,{innerRef:function(t){e._container=t},styles:this.props.styles},i,d.m.createElement(b,{style:{opacity:o},horizontal:r===t.HORIZONTAL,vertical:r===t.VERTICAL}),d.m.createElement(y,{innerRef:function(t){e._root=t},onMouseDown:this._onBarDragStart,onTouchStart:this._onBarDragStart,vertical:"vertical"===this.props.direction,horizontal:"horizontal"===this.props.direction},d.m.createElement(h.a,{onStart:this._onButtonDragStart,onDrag:this._onButtonDrag,onStop:this._onButtonDragStop},d.m.createElement(v,{style:n,visible:this.state.buttonVisible,onMouseDown:this._onButtonDown,vertical:"vertical"===this.props.direction,horizontal:"horizontal"===this.props.direction}))))}}]),t}();m.HORIZONTAL="horizontal",m.VERTICAL="vertical",m.contextTypes=d.b.contextTypes,t.a=m;var g=d.x.div("1ssoezr","ScrollbarContainer");m.RootElement=g;var y=d.x.div("1s3c4f0",{vertical:"1dvqwqc",horizontal:"1hu63yp"},"Scrollbar"),v=d.x.div("zxujnb",{vertical:"gma9v3",horizontal:"1h5ccdj",visible:"2jlos"},"ScrollbarButton"),b=d.x.div("pc5361",{horizontal:"felmtl",vertical:"1enskgl"},"Gradient")},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var i=n(4).x.css("nsck4j","Input")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(306),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(56),_=n(57),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onInputLiveChange","_onInputChange"),o.state={value:o.props.value},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.a),m(t,[{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"_onInputLiveChange",value:function(e){this.setState({value:e.target.value})}},{key:"_onInputChange",value:function(e){var t=parseFloat(e.target.value);if(u()(t))return this.setState({value:this.props.value});var n=this.props,i=n.minValue,r=n.maxValue;t=d.v.toFixed(Math.max(i,Math.min(t,r)),1),this.props.onValueChange&&this.props.onValueChange(t),this.setState({value:t})}},{key:"_renderRightPart",value:function(){var e=this;return d.m.createElement(w,{value:this.state.value,onLiveChange:this._onInputLiveChange,onChange:this._onInputChange,className:void 0,innerRef:function(t){e._input=t},disabled:this.props.disabled})}},{key:"render",value:function(){var e=this.props,t=e.label,n=e.inputLabel,i=e.className,r=e.disabled,o=e.styles,a="function"==typeof this._renderLeftPart;return d.m.createElement(y,{styles:o,className:i,disabled:r},d.m.createElement(v,null,a&&d.m.createElement(b,null,t&&d.m.createElement(k,{left:!0},t),this._renderLeftPart()),d.m.createElement(b,null,n&&d.m.createElement(k,null,n||" "),this._renderRightPart())))}}]),t}();g.contextTypes=h.a.contextTypes,t.a=g;var y=d.x.div("12okzzb",{disabled:"1voy7lm"},"ValueSelection");g.RootElement=y;var v=d.x.div("15u7gri","Row"),b=d.x.div("1hy9z1m",{bottomAligned:"17xdalt"},"Column"),k=d.x.div("ts1901",{left:"1ff3rj6"},"Title"),w=Object(d.x)(_.a)("myl4ow",{disabled:"18if3pn"},"InputField")},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return a});var i=n(4),r=i.x.css("1ht9t4w","CircleSlider"),o=i.x.css("1ldv9bx","CircleSliderBackground"),a=i.x.css("7g0rty","CircleSliderKnob")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(15),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._queue=[],this._pendingPromises=0,this._maxConcurrency=t,this._maxQueueLength=n,this._minDelay=i,this._tick=this._tick.bind(this),this._lastPromiseDone=Date.now(),this._running=!0,this._animationFrameRequest=null,Object(s.b)(this._tick)}return l(e,[{key:"_tick",value:function(){this._running&&(Date.now()-this._lastPromiseDone>this._minDelay&&this._pendingPromises<this._maxConcurrency&&this._queue.length&&this._dequeue(),this._animationFrameRequest=Object(s.b)(this._tick))}},{key:"add",value:function(e){var t=this;return new a.a(function(n,i){if(t._queue.length>=t._maxQueueLength)return i(new Error("Max queue length reached"));t._queue.push({fn:e,resolve:n,reject:i})})}},{key:"_promisify",value:function(e){return void 0!==e&&"function"==typeof e.then?e:a.a.resolve(e)}},{key:"_dequeue",value:function(){var e=this,t=this._queue.shift(),n=Date.now();this._pendingPromises++;try{this._promisify(t.fn()).then(function(i){e._lastPromiseDone=n,e._pendingPromises--,t.resolve(i)}).catch(function(i){e._lastPromiseDone=n,e._pendingPromises--,t.reject(i)})}catch(e){this._lastPromiseDone=n,this._pendingPromises--,t.reject(e)}return!0}},{key:"dispose",value:function(){this._running=!1,this._animationFrameRequest&&Object(s.a)(this._animationFrameRequest)}}]),e}();t.a=c},function(e,t,n){e.exports=!n(18)&&!n(28)(function(){return 7!=Object.defineProperty(n(61)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(36);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,n){var i=n(23),r=n(19),o=n(162)(!1),a=n(68)("IE_PROTO");e.exports=function(e,t){var n,s=r(e),l=0,c=[];for(n in s)n!=a&&i(s,n)&&c.push(n);for(;t.length>l;)i(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var i=n(12).document;e.exports=i&&i.documentElement},function(e,t,n){var i=n(23),r=n(38),o=n(68)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=r(e),i(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var i=n(169),r=n.n(i),o=r.a;r.a},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(39),h=n.n(d),_=n(24),m=n.n(_),g=n(7),y=(n.n(g),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._events={},o._needsStyleFixes=!1,o._bindAll("fixStyles"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.a.Component),y(t,[{key:"fixStyles",value:function(){return u.a.resolve()}},{key:"componentDidMount",value:function(){this._bindEvents(),this._needsStyleFixes&&(this.fixStyles(),this.context.options.responsive&&window.addEventListener("resize",this.fixStyles))}},{key:"componentWillUnmount",value:function(){this._unbindEvents(),(this.context&&this.context.options||this.props.options).responsive&&this._needsStyleFixes&&window.removeEventListener("resize",this.fixStyles)}},{key:"_bindAll",value:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(t){if("function"!=typeof e[t])throw new Error("_bindAll: `"+e.constructor.name+"."+t+"` is not a function.");e[t]=e[t].bind(e)})}},{key:"_t",value:function(e,t){return this.context.ui.translate(e,t)}},{key:"_getAssetPath",value:function(){var e;return(e=this.context.ui).getAssetPath.apply(e,arguments)}},{key:"_bindEvents",value:function(){for(var e in this._events){var t=this._events[e];this.context.mediator.on(e,t)}}},{key:"_unbindEvents",value:function(){for(var e in this._events){var t=this._events[e];this.context.mediator.off(e,t)}}},{key:"_emitEvent",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.context.mediator).emit.apply(t,[e].concat(i))}},{key:"render",value:function(){return h.a.createElement("div",null)}}]),t}();v.contextTypes={appComponent:m.a.object,editor:m.a.object,ui:m.a.object,options:m.a.object,mediator:m.a.object,screen:m.a.object,theme:m.a.object,globalState:m.a.object},t.a=v},function(e,t){},function(e,t,n){"use strict";var i=n(37),r=n(11),o=n(99),a=n(22),s=n(31),l=n(173),c=n(49),u=n(94),f=n(13)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,_,m,g){l(n,t,h);var y,v,b,k=function(e){if(!p&&e in E)return E[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},w=t+" Iterator",S="values"==_,C=!1,E=e.prototype,x=E[f]||E["@@iterator"]||_&&E[_],T=x||k(_),O=_?S?k("entries"):T:void 0,R="Array"==t&&E.entries||x;if(R&&(b=u(R.call(new e)))!==Object.prototype&&b.next&&(c(b,w,!0),i||"function"==typeof b[f]||a(b,f,d)),S&&x&&"values"!==x.name&&(C=!0,T=function(){return x.call(this)}),i&&!g||!p&&!C&&E[f]||a(E,f,T),s[t]=T,s[w]=d,_)if(y={values:S?T:k("values"),keys:m?T:k("keys"),entries:O},g)for(v in y)v in E||o(E,v,y[v]);else r(r.P+r.F*(p||C),t,y);return y}},function(e,t,n){e.exports=n(22)},function(e,t,n){var i=n(14);e.exports=function(e,t,n,r){try{return r?t(i(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&i(o.call(e)),t}}},function(e,t,n){var i=n(31),r=n(13)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[r]===e)}},function(e,t,n){var i=n(14),r=n(46),o=n(13)("species");e.exports=function(e,t){var n,a=i(e).constructor;return void 0===a||void 0==(n=i(a)[o])?t:r(n)}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var i=n(14),r=n(17),o=n(74);e.exports=function(e,t){if(i(e),r(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var i=n(13)("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var n=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:n=!0}},o[i]=function(){return a},e(o)}catch(e){}return n}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(){h&&p&&(h=!1,p.length?d=p.concat(d):_=-1,d.length&&a())}function a(){if(!h){var e=r(o);h=!0;for(var t=d.length;t;){for(p=d,d=[];++_<t;)p&&p[_].run();_=-1,t=d.length}p=null,h=!1,function(e){if(u===clearTimeout)return clearTimeout(e);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,u,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{u="function"==typeof clearTimeout?clearTimeout:i}catch(e){u=i}}();var p,d=[],h=!1,_=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new s(e,t)),1!==d.length||h||r(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){e.exports={default:n(191),__esModule:!0}},function(e,t,n){var i=n(47)("meta"),r=n(17),o=n(23),a=n(16).f,s=0,l=Object.isExtensible||function(){return!0},c=!n(28)(function(){return l(Object.preventExtensions({}))}),u=function(e){a(e,i,{value:{i:"O"+ ++s,w:{}}})},f=e.exports={KEY:i,NEED:!1,fastKey:function(e,t){if(!r(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,i)){if(!l(e))return"F";if(!t)return"E";u(e)}return e[i].i},getWeak:function(e,t){if(!o(e,i)){if(!l(e))return!0;if(!t)return!1;u(e)}return e[i].w},onFreeze:function(e){return c&&f.NEED&&l(e)&&!o(e,i)&&u(e),e}}},function(e,t,n){var i=n(92),r=n(70).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},function(e,t,n){e.exports={default:n(228),__esModule:!0}},function(e,t,n){(function(t){(function(){var n,i,r;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-r)/1e6},i=t.hrtime,r=(n=function(){var e;return 1e9*(e=i())[0]+e[1]})()):Date.now?(e.exports=function(){return Date.now()-r},r=Date.now()):(e.exports=function(){return(new Date).getTime()-r},r=(new Date).getTime())}).call(this)}).call(t,n(106))},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(107),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(242),g=n(243),y=n(113),v=n(244),b=n(245),k=n(246),w=n(247),S=n(249),C=n(80),E=n(114),x=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),O=function(e){function t(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).call(this));if(o._ui=e,o._options=n,o._mediator=i,o._ready=!1,o._padding=[0,0,0,0],o._offset=new _.w(0,0),o._shallow=r,r||(o._initSDK(),o._onZoom=o._onZoom.bind(o),o._onUndo=o._onUndo.bind(o),o._onRedo=o._onRedo.bind(o),o.history=new S.a(o,o._sdk,o._mediator),o.history.on("undo",o._onUndo),o.history.on("redo",o._onRedo),o.zoom=new w.a(o,o._sdk,o._mediator),o.zoom.on("set",o._onZoom),o._initSerializers()),o._dynamicAssetsLibrary=new E.a,o.operations=new v.a(o,o._sdk,o._mediator),o.controls=new b.a(o,o._sdk,o._mediator),o.features=new k.a(o,o._sdk,o._mediator),o._sdk){var a=[];for(var s in o._operations)a.push(o._operations[s]);o._sdk.registerOperations(a)}return o._running=!1,o._renderRequested=!0,o._renderCallbacks=[],o._animationFrameRequest=null,o.render=o.render.bind(o),o._tick=o._tick.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.e),T(t,[{key:"setImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._options.editor.image,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this._sdk.getRenderer(),r=new _.w(t.naturalWidth,t.naturalHeight),o=1e6*this.getMaxMegapixels(),a=i.getMaxDimensions();n&&this.reset();var s=new g.a(t,o,a),l=null,c=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,i=void(arguments.length>2&&void 0!==arguments[2]&&arguments[2]),o=void 0;e._sdk.getImage()&&(i=e.getInputDimensions(),o=n.clone().divide(i)),e._setImage(t,l,n),o&&e.broadcastScale(o),e._initWatermark(),e._ready=!0,e.emit("ready")};s.needsResize()?(this.emit("resize"),l=this._sdk.parseExif(t),s.resize().then(function(t){var n=t.canvas,i=t.dimensions,r=t.reason;n.src="data:image/jpeg;base64,",e.emit("resized",{dimensions:i,reason:r}),c(n,i,r)})):c(t)}},{key:"_initWatermark",value:function(){this._options.editor.watermarkImage&&(this._watermarkOperation=this.operations.getOrCreate("watermark",{image:this._options.editor.watermarkImage}))}},{key:"_initSDK",value:function(){var e=this._options,t=e.logLevel,n=e.displayWelcomeMessage,i=e.debug,r=e.license,o=e.crossOrigin,a=this._options.editor,s=a.smoothDownscaling,l=a.smoothUpscaling,c=a.preferredRenderer,u=a.pixelRatio,f=a.transparent,p=a.clearColor,d=void 0;Array.isArray(p)?d=_.c.fromArray(p):"string"==typeof p?d=_.c.fromHex(p):p instanceof _.c&&(d=p.clone());var h={logLevel:t,debug:i,displayWelcomeMessage:n,pixelRatio:u,smoothDownscaling:s,smoothUpscaling:l,transparent:f,crossOrigin:o,clearColor:d,license:r};this._sdk=new _.q(c,h)}},{key:"_onZoom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.fixOffset(),this.render(function(){t&&t()})}},{key:"fixOffset",value:function(){this._offset=this._clampOffset(this._offset)}},{key:"_onUndo",value:function(){this.render()}},{key:"_onRedo",value:function(){this.render()}},{key:"getRotation",value:function(){return this._sdk.getRotation()}},{key:"setRotation",value:function(e){this._sdk.setRotation(e)}},{key:"getSpriteScale",value:function(){return this._sdk.getSpriteScale()}},{key:"setSpriteScale",value:function(e){this._sdk.setSpriteScale(e)}},{key:"getCrossOrigin",value:function(){return _.r.getCrossOriginValue(this._options.crossOrigin||"anonymous")}},{key:"isToolAllowed",value:function(e){return!!this._shallow||this._sdk._l.isToolAllowed(e)}},{key:"isToolEnabled",value:function(e){return-1!==this._options.editor.tools.indexOf(e)}},{key:"getMaxMegapixels",value:function(){var e=this._options.editor.maxMegaPixels;return _.v.isMobile()?e.mobile:e.desktop}},{key:"getOutputDimensions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sdk.getOutputDimensions(e)}},{key:"getOutputTextureDimensions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sdk.getOutputTextureDimensions(e)}},{key:"getFinalDimensions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sdk.getFinalDimensions(e)}},{key:"getCanvasDimensions",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this._sdk.getCanvas(),n=new _.w(t.offsetWidth,t.offsetHeight);return e&&n.subtract(this._padding[1]+this._padding[3],this._padding[0]+this._padding[2]),n}},{key:"_setImage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._options.editor.image,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._sdk.setAllOperationsToDirty(),this._options.editor.image=e,this._sdk.setImage(e,t,n),this.zoom.auto(!0,!0),this.emit("new-image")}},{key:"export",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._watermarkOperation&&this._watermarkOperation.setEnabled(!1),this._sdk.setAllOperationsToDirty();var n=this._options.editor.export;return new m.a(this._sdk,n,t).export().then(function(t){return e.emit(_.d.EVENTS.EXPORT,t),e._mediator.emit(_.d.EVENTS.EXPORT,t,e),e._watermarkOperation&&(e._watermarkOperation.setEnabled(!0),e._sdk.render()),e._sdk.setAllOperationsToDirty(),t})}},{key:"save",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this._options.editor.save;return this.serialize({image:n.image}).then(function(i){var r=p()(i);if(e.emit(_.d.EVENTS.SAVE,i),e._mediator.emit(_.d.EVENTS.SAVE,i,e),t){var o="data:text/json;charset=utf-8;base64,"+window.encodeURI(window.btoa(r));y.a.downloadDataURL(o,n.fileBasename)}return r})}},{key:"load",value:function(e){var t=this,n=window.JSON.parse(e);return this.deserialize(n).then(function(e){return t.emit(_.d.EVENTS.LOAD,e),t._mediator.emit(_.d.EVENTS.LOAD,e,t),e})}},{key:"_initSerializers",value:function(){this._serializers={"1.0.0":n(253).default,"1.0.1":n(261).default,"2.0.0":n(262).default,"2.0.1":n(263).default,"3.0.0":n(266).default,"3.1.0":n(271).default,"3.2.0":n(272).default,"3.4.0":n(273).default,"3.5.0":n(274).default,"3.6.0":n(275).default,"3.7.0":n(276).default}}},{key:"serialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"3.7.0",n=this._serializers[t];return n?new n(this).serialize(e):_.j.reject(new Error("No serializer for version "+t+" found."))}},{key:"deserialize",value:function(e){var t=this,n=this._serializers[e.version];return n?new n(this).deserialize(e).then(function(){t.zoom.auto(!0,!0)}):_.j.reject(new Error("No serializer for version "+e.version+" found."))}},{key:"_applyOffset",value:function(){var e=this._offset.clone();e.x-=this._padding[1]/2,e.x+=this._padding[3]/2,e.y-=this._padding[2]/2,e.y+=this._padding[0]/2,this._sdk.setOffset(e)}},{key:"start",value:function(){this._animationFrameRequest=Object(_.A)(this._tick)}},{key:"stop",value:function(){this._running=!1,this._animationFrameRequest&&(Object(_.y)(this._animationFrameRequest),this._renderCallbacks=[])}},{key:"render",value:function(e){this._renderRequested=!0,e&&this._renderCallbacks.push(e)}},{key:"_tick",value:function(){var e=this;if(this.zoom.tick(),this._renderRequested){var t=this._renderCallbacks.slice(0);this._renderCallbacks=[],this._render().then(function(){t.forEach(function(e){return e()}),e._animationFrameRequest=Object(_.A)(e._tick)}),this._renderRequested=!1}else this._animationFrameRequest=Object(_.A)(this._tick)}},{key:"_render",value:function(){var e=this;return this._ready?(this._applyOffset(),this._sdk.render().then(function(t){var n=t.renderDone;e._lastOutputBounds=e._sdk.getSprite().getBounds(),n?e.emit("rendered"):e._renderRequested=!0}).catch(function(t){_.h.error(e.constructor.name,"An error occurred while rendering: "+t.message),e.emit("render-error",t)})):_.j.resolve()}},{key:"reset",value:function(){this._sdk.reset(),this.history.reset(),this.operations.reset(),this.features.reset(),this.setRotation(0),this.setSpriteScale(1),this.emit("reset")}},{key:"dispose",value:function(){this.stop(),this._sdk.dispose()}},{key:"isReady",value:function(){return this._ready}},{key:"getRenderer",value:function(){return this._sdk.getRenderer()}},{key:"getSDK",value:function(){return this._sdk}},{key:"getInputDimensions",value:function(){return this._sdk.getInputDimensions()}},{key:"getPadding",value:function(){return this._padding}},{key:"setPadding",value:function(e){this._padding=e||[0,0,0,0]}},{key:"getSnappingOptions",value:function(){var e=this._options.editor.snappingOptions.position,t=this._options.editor.snappingOptions.rotation,n=this._sdk.getOutputDimensions(!1),i=n.min()*e.padding.left,r=n.min()*e.padding.right,o=n.min()*e.padding.top,a=n.min()*e.padding.bottom,s=i/n.x,l=r/n.x,c=o/n.y,u=a/n.y,f=e.threshold/n.min(),p=[];t.angles.forEach(function(e){p.push(e),p.push(e+360),p.push(e-360)});var d=p.filter(function(e,t){return p.indexOf(e)===t});return{rotation:x({},t,{enabled:this._options.editor.enableRotationSnapping,guides:d.map(function(e){return new C.a({value:e*Math.PI/180,edges:[C.a.Edge.CENTER]})})}),position:x({},e,{enabled:this._options.editor.enablePositionSnapping,threshold:f,verticalGuides:[new C.a({value:s,edges:[C.a.Edge.LEADING]}),new C.a({value:.5,edges:[C.a.Edge.CENTER]}),new C.a({value:1-l,edges:[C.a.Edge.TRAILING]})],horizontalGuides:[new C.a({value:c,edges:[C.a.Edge.LEADING]}),new C.a({value:.5,edges:[C.a.Edge.CENTER]}),new C.a({value:1-u,edges:[C.a.Edge.TRAILING]})]})}}},{key:"getImage",value:function(){return this._options.editor.image}},{key:"getOptions",value:function(){return this._options}},{key:"getUI",value:function(){return this._ui}},{key:"broadcastScale",value:function(e){var t=this;["sprite"].forEach(function(n){var i=t.operations.get(n);i&&i.scale(e)})}},{key:"broadcastTransform",value:function(e,t){var n=this,i=new _.q.Operations.TransformOperation.TransformChange(e,t);["sprite","selective-blur","radial-focus","mirrored-focus","linear-focus","blur"].forEach(function(e){var t=n.operations.get(e);t&&t.transform(i)})}},{key:"broadcastTemporaryTransform",value:function(e,t){var n=this,i=new _.q.Operations.TransformOperation.TransformChange(e,t),r=new _.q.Operations.TransformOperation.TransformChange(e,t).invert();["sprite","selective-blur","radial-focus","mirrored-focus","linear-focus","blur"].forEach(function(e){var t=n.operations.get(e);t&&t.setTemporaryTransformChange(i,r)})}},{key:"broadcastFlip",value:function(e){var t=this;["mirrored-focus","radial-focus","linear-focus","sprite","selective-blur"].forEach(function(n){var i=t.operations.get(n);i&&i.flip(e)})}},{key:"broadcastRotate",value:function(e){var t=this;["transform","mirrored-focus","radial-focus","linear-focus","sprite","selective-blur"].forEach(function(n){var i=t.operations.get(n);i&&i.rotate(e)})}},{key:"_clampOffset",value:function(e){var t=this.getCanvasDimensions(),n=this._sdk.getOutputDimensions(!1),i=t.clone().subtract(n).divide(2).clamp(null,new _.w(0,0)),r=n.clone().subtract(t).divide(2).clamp(new _.w(0,0),null);return e.clone().clamp(i,r).round()}},{key:"getSnapshot",value:function(){return{operations:this.operations.getSnapshot(),zoom:this.zoom.getSnapshot(),canvasDimensions:this.getCanvasDimensions()}}},{key:"restoreSnapshot",value:function(e){this.operations.restoreSnapshot(e.operations),this.zoom.restoreSnapshot(e.zoom),e.canvasDimensions.equals(this.getCanvasDimensions())||this.zoom.auto(!0,!0)}},{key:"getMediator",value:function(){return this._mediator}},{key:"getDynamicAssetsLibrary",value:function(){return this._dynamicAssetsLibrary}},{key:"addSticker",value:function(e,t){var n=this._options.editor,i=_.r.getDeepProperty(n,["controlsOptions","sticker","categories"]);if(!i)return!1;var r=_.r.getDeepProperty(i,[function(t){return t.filter(function(t){return t.identifier===e})[0]},"stickers"]);return!!r&&(r.push(t),this._mediator.emit(_.d.EVENTS.ADDED_STICKER,i),!0)}},{key:"offset",get:function(){return this._offset},set:function(e){this._offset=this._clampOffset(e)}},{key:"isDraggable",get:function(){var e=this.zoom.targetLevel>this.zoom.defaultLevel;return this.features.isEnabled("drag")&&e}},{key:"isShallow",get:function(){return this._shallow}}]),t}();t.a=O},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return a(e,null,[{key:"downloadDataURL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photoeditorsdk-export",n=this.createBlobURLFromDataURL(e),i=this.getExtensionFromDataURL(e),r=document.createElement("a");r.download=t+"."+i,r.href=n,document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"downloadMSBlob",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"photoeditorsdk-export";navigator.msSaveBlob(e,t+".png")}},{key:"getExtensionFromDataURL",value:function(e){return e.split(",")[0].split(":")[1].split(";")[0].split("/").pop()}},{key:"createBlobURLFromDataURL",value:function(e){if(!(window.Blob&&window.URL&&ArrayBuffer&&Uint8Array))return e;for(var t=o.a.decode(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),a=0;a<t.length;a++)r[a]=t[a];var s=new window.Blob([i],{type:n});return window.URL.createObjectURL(s)}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._assetsByGroupId={}}return o(e,[{key:"addAsset",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._assetsByGroupId[e]?n?this._assetsByGroupId[e].unshift(t):this._assetsByGroupId[e].push(t):this._assetsByGroupId[e]=[t]}},{key:"setAssets",value:function(e,t){this._assetsByGroupId[e]=t}},{key:"getAssets",value:function(e){return this._assetsByGroupId[e]=this._assetsByGroupId[e]||[],this._assetsByGroupId[e]}}]),e}();t.a=a},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(4),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=2*Math.PI,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t,this._serializeOperations=this._serializeOperations.bind(this)}return l(e,[{key:"serialize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._options=s.r.defaults(e,{image:!0});var t={version:this.constructor.version};return this._serializeInputImage(t).then(this._serializeOperations)}},{key:"_serializeInputImage",value:function(e){var t=this._editor.getImage(),n=t.width,i=t.height;if(!this._options.image)return e.inputImage={width:n,height:i},a.a.resolve(e);var r=s.r.createCanvas();r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0);var o=r.toDataURL(s.f.PNG);return e.inputImage={type:s.f.PNG,data:o.replace(/^data:image\/(.*?);base64,/,""),width:n,height:i},a.a.resolve(e)}},{key:"_serializeOperations",value:function(e){var t=this,n=[];return this._editor.operations.getStack().forEach(function(e){var i=t._serializeOperation(e,n);i&&n.push(i)}),e.operations=n.filter(function(e){return e}),a.a.resolve(e)}},{key:"_serializeOperation",value:function(e,t){switch(e.constructor.identifier){case"transform":return this._serializeTransformOperation(e);case"orientation":return this._serializeOrientationOperation(e);case"filter":return this._serializeFilterOperation(e);case"adjustments":return this._serializeAdjustmentsOperation(e);case"sprite":return this._serializeSpriteOperation(e,t);case"radial-focus":return this._serializeRadialFocusOperation(e);case"mirrored-focus":return this._serializeLinearFocusOperation(e);default:s.h.warn("Unable to serialize operation of type "+e.constructor.identifier)}}},{key:"_serializeTransformOperation",value:function(e){var t=e.serializeOptions(["start","end","rotation"],!0);return t.rotation=(t.rotation+c)%c,{type:"crop",options:t}}},{key:"_serializeOrientationOperation",value:function(e){return{type:"orientation",options:e.serializeOptions(["flipVertically","flipHorizontally","rotation"],!0)}}},{key:"_serializeFilterOperation",value:function(e){return"identity"===e.getIdentifier()?null:{type:"filter",options:{intensity:e.getIntensity(),name:e.getIdentifier()}}}},{key:"_serializeAdjustmentsOperation",value:function(e){var t=e.availableOptions,n={};return["brightness","saturation","contrast","exposure","shadows","highlights","clarity"].forEach(function(i){var r=t[i],o=e.getOption(i),a=r.minValue,s=r.midValue,l=r.maxValue;n[i]=o<=s?(o-a)/(s-a)-1:(o-s)/(l-s)}),{type:"adjustments",options:n}}},{key:"_serializeSpriteOperation",value:function(e,t){var n=this,i=t.filter(function(e){return"sprite"===e.type}),r=void 0,o=!0;if(i.length?(r=i.pop(),o=!1):r={type:"sprite",options:{sprites:[]}},e.getSprites().forEach(function(t){var i=null;t instanceof e.constructor.StickerSprite?i=n._serializeSticker(e,t):t instanceof e.constructor.TextSprite?i=n._serializeText(e,t):t instanceof e.constructor.BrushSprite?i=n._serializeBrush(e,t):t instanceof e.constructor.TextDesignSprite&&(i=n._serializeTextDesign&&n._serializeTextDesign(e,t)),i&&r.options.sprites.push(i)}),o)return r}},{key:"_serializeSticker",value:function(e,t){var n=t.getAdjustments(),i=t.serializeOptions(["identifier","position","dimensions","flipVertically","flipHorizontally","rotation"],!0);i.name=i.identifier,delete i.identifier,i.rotation=(i.rotation+c)%c;var r=n.availableOptions;return i.adjustments={brightness:n.getBrightness()-r.brightness.default,saturation:n.getSaturation()-r.saturation.default,contrast:n.getContrast()-r.contrast.default},{type:"sticker",options:i}}},{key:"_serializeText",value:function(e,t){var n=t.serializeOptions(["fontSize","lineHeight","fontFamily","fontWeight","alignment","color","backgroundColor","position","rotation","text","maxWidth"],!0);return n.rotation=(n.rotation+c)%c,{type:"text",options:n}}},{key:"_serializeBrush",value:function(e,t){var n=this;return{type:"brush",options:{paths:t.getPaths().map(function(e){return n._serializePath(e)})}}}},{key:"_serializePath",value:function(e){var t=e.getBrush().serializeOptions(["color","size"],!0);return t.points=e.getControlPoints().map(function(e){return e.getPosition().toObject()}),t}},{key:"_serializeRadialFocusOperation",value:function(e){return{type:"focus",options:{type:"radial",options:e.serializeOptions(["position","radius","gradientRadius","blurRadius"],!0)}}}},{key:"_serializeLinearFocusOperation",value:function(e){return{type:"focus",options:{type:"linear",options:e.serializeOptions(["start","end","blurRadius","size","gradientSize"],!0)}}}},{key:"_getInputDimensionsForOperation",value:function(e){var t=!1,n=this._editor.getInputDimensions();return this._editor.operations.getStack().forEach(function(i){i===e&&(t=!0),t||(n=i.getNewDimensions(n))}),n}}]),e}();t.a=u,u.version="1.0.0"},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(2),o=n.n(r),a=n(3),s=n.n(a),l=n(0),c=n.n(l),u=n(1),f=n.n(u),p=n(117),d=n.n(p),h=n(8),_=n.n(h),m=n(4),g=n(118),y=n(54),v=n(119),b=n(26),k=n(81),w=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),c()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),S=void 0;void 0!==m.q.Operations.SpriteOperation&&(S=m.q.Operations.SpriteOperation.BrushSprite);var C=function(){function e(t,n){i(this,e),this._editor=t,this._ui=this._editor.getUI(),this._data=n,this._filterManager=new g.a(this._ui,this._getOptions("filter")),this._stickerManager=new y.a(this._ui,this._getOptions("sticker")),this._brushManager=new v.a(this._ui,this._getOptions("brush")),this._fontManager=new b.a(this._ui,this._getOptions("text"))}return w(e,[{key:"_getOptions",value:function(e){var t=this._editor.controls,n={};t&&t.get(e)&&(n=t.get(e).defaultOptions);var i=this._editor.getOptions();return m.r.deepDefaults({},i.editor.controlsOptions[e]||{},n)}},{key:"deserialize",value:function(){var e=this;return this._validateVersion().then(function(){return e._deserializeInputImage()}).then(function(){return e._deserializeOperations()})}},{key:"_validateVersion",value:function(){return this._data.version!==this.constructor.version?_.a.reject(new Error("Invalid version "+this._data.version+", expected "+this.constructor.version)):_.a.resolve()}},{key:"_deserializeInputImage",value:function(){var e=this;return new _.a(function(t,n){var i=e._data.inputImage,r=i.data,o=i.type;if(r&&o){var a=new window.Image;a.addEventListener("load",function(){e._editor.setImage(a),t()}),a.src="data:"+o+";base64,"+r}else t()})}},{key:"_deserializeOperations",value:function(){var e=function(e){return function(){var t=e.apply(this,arguments);return new _.a(function(e,n){return function i(r,o){try{var a=t[r](o),s=a.value}catch(e){return void n(e)}if(!a.done)return _.a.resolve(s).then(function(e){i("next",e)},function(e){i("throw",e)});e(s)}("next")})}}(d.a.mark(function e(){var t,n,i,r,o;return d.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this._data.operations,n=[],i=0;case 3:if(!(i<t.length)){e.next=12;break}return r=t[i],e.next=7,this._deserializeOperation(r);case 7:o=e.sent,n.push(o);case 9:i++,e.next=3;break;case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_deserializeOperation",value:function(e){switch(e.type){case"crop":return this._deserializeCropOperation(e);case"orientation":return this._deserializeOrientationOperation(e);case"filter":return this._deserializeFilterOperation(e);case"adjustments":return this._deserializeAdjustmentsOperation(e);case"sprite":return this._deserializeSpriteOperation(e);case"focus":return this._deserializeFocusOperation(e)}}},{key:"_deserializeCropOperation",value:function(e){var t=e.options,n=t.rotation,i=m.w.fromObject(t.start),r=m.w.fromObject(t.end);n>Math.PI&&(n-=2*Math.PI);var o={start:i,end:r};void 0!==n&&(o.rotation=n);var a=this._editor.operations.getOrCreate("transform");return this._editor.broadcastTransform(a,o),a.set(o),_.a.resolve(a)}},{key:"_deserializeOrientationOperation",value:function(e){var t=e.options,n=this._editor.operations.getOrCreate("orientation");return n?(n.set(t),_.a.resolve(n)):_.a.resolve()}},{key:"_deserializeFilterOperation",value:function(e){var t=this,n=e.options;return this._filterManager.getFilterByIdentifier(n.name)?this._filterManager.instantiateFilterWithIdentifier(n.name).then(function(e){var i=t._editor.operations.getOrCreate("filter");return i.set({identifier:n.name,filter:e,intensity:n.intensity}),i}):(m.h.warn("Deserializer","Unknown filter `"+n.name+"`"),_.a.resolve())}},{key:"_deserializeAdjustmentsOperation",value:function(e){var t=m.q.Operations.AdjustmentsOperation,n=e.options,i={};return["brightness","saturation","contrast","exposure","shadows","highlights","clarity"].forEach(function(e){if(void 0!==n[e]){var r=t.prototype.availableOptions[e],o=r.minValue,a=r.midValue,s=r.maxValue,l=n[e];l=l<0?a+(a-o)*l:a+(s-a)*l,i[e]=l}}),_.a.resolve(this._editor.operations.getOrCreate("adjustments",i))}},{key:"_deserializeSpriteOperation",value:function(e){var t=this,n=e.options,i=this._editor.operations.getOrCreate("sprite");if(!i)return _.a.resolve();var r=n.sprites.map(function(e){return t._deserializeSprite(i,e)}).filter(function(e){return e});return _.a.all(r).then(function(e){return i.setSprites(e.filter(function(e){return e})),i})}},{key:"_deserializeSprite",value:function(e,t){switch(t.type){case"sticker":return this._deserializeSticker(e,t);case"text":return this._deserializeText(e,t);case"brush":return this._deserializeBrush(e,t);case"textdesign":return this._deserializeTextDesign&&this._deserializeTextDesign(e,t)}}},{key:"_deserializeSticker",value:function(e,t){var n=this,i=m.q.Operations.SpriteOperation,r=t.options,o=this._stickerManager.getStickerByIdentifier(r.name),a=this._stickerManager.getURLForSticker(o);return o?new _.a(function(t,o){var s=new window.Image;s.addEventListener("load",function(){var n=i.StickerSprite.prototype.availableOptions.adjustments.structure,o=r.rotation,a=r.flipHorizontally,l=r.flipVertically,c={identifier:r.name,image:s,position:m.w.fromObject(r.position),dimensions:m.w.fromObject(r.dimensions),rotation:o,flipHorizontally:a,flipVertically:l,adjustments:{}};void 0!==r.adjustments&&["brightness","contrast","saturation"].forEach(function(e){void 0!==r.adjustments[e]&&(c.adjustments[e]=r.adjustments[e]+n[e].default)}),t(e.createSticker(c))}),s.crossOrigin=n._editor.getCrossOrigin(),s.src=n._editor.getUI().getAssetPath(a)}):(m.h.warn("Deserializer","Unknown sticker '"+r.name+"'. Skipping sprite."),_.a.resolve())}},{key:"_deserializeText",value:function(e,t){var n=t.options,i=n.fontSize,r=n.lineHeight,o=n.fontFamily,a=n.fontWeight,s=n.alignment,l=n.rotation,c=n.maxWidth,u=n.color,f=n.backgroundColor,p=new k.a(this._ui),d=this._fontManager.getFontByFontFamily(o);return d||(d=this._fontManager.getDefaultFont()),p.setFonts([d]),p.load().then(function(){var t=e.createText({fontSize:i,lineHeight:r,fontFamily:o,fontWeight:a,alignment:s,rotation:l,maxWidth:c,text:n.text,color:m.c.fromArray(u),backgroundColor:m.c.fromArray(f),position:m.w.fromObject(n.position)});return t._edited=!0,t})}},{key:"_deserializeBrush",value:function(e,t){var n=this,i=t.options.paths,r=e.createBrush();return i.forEach(function(e){n._deserializeBrushPath(r,e)}),_.a.resolve(r)}},{key:"_deserializeBrushPath",value:function(e,t){var n=t.points,i=this._createBrushForPath(t),r=e.createPath(i);r.setClosed(!0),n.forEach(function(e){r.addControlPoint(m.w.fromObject(e))})}},{key:"_createBrushForPath",value:function(e){var t=e.color,n=e.size,r={color:m.c.fromArray(t),size:n},a=this._brushManager.getFirstBrush();if(a.prototype&&a.prototype instanceof S)return new a(r);var l=m.r.extend({},a);delete l.image;var c=function(e){function t(){return i(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||f()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=s()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.a?o()(e,t):e.__proto__=t)}(t,S),t}();return c.identifier=a.identifier,new c(m.r.extend({},l,r))}},{key:"_deserializeFocusOperation",value:function(e){var t=e.options.options;switch(e.options.type){case"radial":var n=t.position,i=t.radius,r=t.gradientRadius,o=t.blurRadius;return _.a.resolve(this._editor.operations.getOrCreate("radial-focus",{position:m.w.fromObject(n),radius:i,gradientRadius:r,blurRadius:o}));case"linear":var a=t.start,s=t.end,l=t.size,c=t.gradientSize,u=t.blurRadius;return _.a.resolve(this._editor.operations.getOrCreate("mirrored-focus",{start:m.w.fromObject(a),end:m.w.fromObject(s),size:l,gradientSize:c,blurRadius:u}))}}},{key:"_getInputDimensionsForOperation",value:function(e){var t=!1,n=this._editor.getInputDimensions();return this._editor.operations.getStack().forEach(function(i){i===e&&(t=!0),t||(n=i.getNewDimensions(n))}),n}}]),e}();t.a=C,C.version="1.0.0"},function(e,t,n){e.exports=n(254)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(4),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._categoriesById={},this._filtersByIdentifier={identity:s.q.Operations.FilterOperation.Filters.IdentityFilter},this._categories=s.v.wrapFiltersInCategories(s.s.DEFAULTS.FILTERS.slice(0),e.CATEGORY_ITEMS_PROPERTY),this._options.categories&&(this._options.categories=s.v.wrapFiltersInCategories(this._options.categories,e.CATEGORY_ITEMS_PROPERTY)),this._initCategories()}return l(e,[{key:"instantiateFilterWithIdentifier",value:function(e){var t=this,n=this.getFilterByIdentifier(e);if(!n)return a.a.reject(new Error("Unknown filter with identifier `"+e+"`!"));if(n.prototype instanceof s.q.Operations.FilterOperation.Filter)return a.a.resolve(new n);var i=n.lutImage,r=n.resolution,o=n.horizontalTileCount,l=n.verticalTileCount,c=n.lightColor,u=n.darkColor;if(c&&u)return c=s.c.fromHex(c),u=s.c.fromHex(u),a.a.resolve(new s.q.Operations.FilterOperation.Filters.DuoToneFilter({lightColor:c,darkColor:u}));var f=void 0;return this._ui.getPreloader&&(f=this._ui.getPreloader().getAsset(i)),(f?a.a.resolve(f):s.g.load(this._ui.getAssetPath(i))).then(function(){return s.g.load(t._ui.getAssetPath(i)).then(function(e){return new s.q.Operations.FilterOperation.Filters.ThreeDLUTFilter({image:e,resolution:r,horizontalTileCount:o,verticalTileCount:l})})})}},{key:"_initCategories",value:function(){var t=this;if(this._options.categories&&(this._options.replaceCategories?this._categories=s.v.wrapFiltersInCategories(this._options.categories,e.CATEGORY_ITEMS_PROPERTY):this._categories=s.v.mergeCategories(this._categories,this._options.categories,e.CATEGORY_ITEMS_PROPERTY)),this._options.availableFilters){var n=[];this._categories.forEach(function(e){var i=e.filters.filter(function(e){return-1!==t._options.availableFilters.indexOf(e.identifier)});i.length>0&&n.push({identifier:e.identifier,defaultName:e.defaultName,filters:i})}),this._categories=n}var i={identifier:"all",defaultName:"All",visible:!1,filters:this._categories.length<=0?[]:this._categories.map(function(e){return e.filters}).reduce(function(e,t){return e.concat(t)})};this._categories.unshift(i),this._categoriesById.all=i,this._categories.forEach(function(e){t._categoriesById[e.identifier]=e}),i.filters.forEach(function(e){t._filtersByIdentifier[e.identifier]=e})}},{key:"getFiltersForCategory",value:function(e){if(!this._categoriesById[e])throw new Error("Unknown filter category '"+e+"'");return this._categoriesById[e].filters}},{key:"getItemsByCategory",value:function(e){return this.getFiltersForCategory(e)}},{key:"getFilterByIdentifier",value:function(e){return this._filtersByIdentifier[e]}},{key:"getCategories",value:function(){return this._categories}},{key:"getCategoryByIdentifier",value:function(e){return this._categoriesById[e]}}]),e}();c.CATEGORY_ITEMS_PROPERTY="filters",t.a=c},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._brushes=[],this._brushesById={},this._addBrushes(o.d.DEFAULTS.BRUSHES);var i=this._options,r=i.brushes,a=i.replaceBrushes,s=i.availableBrushes;this._options.brushes&&this._addBrushes(r,a),s&&(this._brushes=this._brushes.filter(function(e){return-1!==s.indexOf(e.identifier)}))}return a(e,[{key:"_addBrushes",value:function(e,t){var n=this;t&&(this._brushes=[],this._brushesById={}),e.forEach(function(e){n._brushes.push(e),n._brushesById[e.identifier]=e})}},{key:"getBrushByIdentifier",value:function(e){return this._brushesById[e]}},{key:"getBrushes",value:function(){return this._brushes}},{key:"getFirstBrush",value:function(){return this._brushes[0]}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d={100:"Extra Light",200:"Light",300:"Book",400:"Regular",500:"Medium",600:"Semibold",700:"Bold",800:"Black",900:"Extra Black",bold:"Bold",normal:"Regular"},h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.Configurable),p(t,[{key:"getLabel",value:function(){var e=d[this._options.fontWeight];switch(this._options.fontStyle){case"italic":e+=" Italic"}return e}}]),t}();t.a=h,h.prototype.availableOptions={identifier:{type:f.OptionType.STRING,required:!0},fontFamily:{type:f.OptionType.STRING,required:!0},fontWeight:{type:f.OptionType.ALL,default:400},fontStyle:{type:f.OptionType.STRING,default:"normal"},textMetrics:{type:f.OptionType.OBJECT,default:null},provider:{type:f.OptionType.STRING,available:["google","file"]},filePath:{type:f.OptionType.STRING},default:{type:f.OptionType.BOOLEAN,default:!1},font:{type:f.OptionType.OBJECT}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(258),l=n(7),c=(n.n(l),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._fonts=[],this._observers=[]}return c(e,[{key:"add",value:function(e){this._fonts.push(e)}},{key:"load",value:function(){var e=this;return 0===this._fonts.length?a.a.resolve():(this._observers=[],this._fonts.forEach(function(t){e._observers.push(new s.a(t))}),l.Utils.executePromises(this._observers.map(function(e){return e.observe()})))}},{key:"dispose",value:function(){this._observers.forEach(function(e){return e.dispose()})}}]),e}();t.a=u},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(115),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=2*Math.PI,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.a),p(t,[{key:"_serializeTransformOperation",value:function(e){var t=e.serializeOptions(["start","end","rotation","textureScale"],!0);return t.rotation=(t.rotation+d)%d,1!==t.textureScale&&(t.dimensions=e.getNewDimensions(e.getInputDimensions(!1))),delete t.textureScale,{type:"crop",options:t}}}]),t}();t.a=h,h.version="1.0.1"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(116),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,m.a),g(t,[{key:"_deserializeOperation",value:function(e){return"selective-blur"===e.type?this._deserializeSelectiveBlurOperation(e):function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"_deserializeOperation",this).call(this,e)}},{key:"_deserializeCropOperation",value:function(e){var t=e.options,n=t.rotation,i=_.w.fromObject(t.start),r=_.w.fromObject(t.end),o=t.dimensions?_.w.fromObject(t.dimensions):null;if(r.x-i.x<=0||r.y-i.y<=0)throw new Error("A crop should not result in negative or zero dimensions - start: "+i+" - end: "+r);n>Math.PI&&(n-=2*Math.PI);var a={start:i,end:r};void 0!==n&&(a.rotation=n);var s=this._editor.operations.getOrCreate("transform");if(!s)return p.a.resolve();if(this._editor.broadcastTransform(s,a),s.set(a),o){var l=r.clone().subtract(i),c=s.getInputDimensions(!1).multiply(l);s.setTextureScale(o.x/c.x)}return p.a.resolve(s)}}]),t}();t.a=y,y.version="1.0.1"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._categoriesById={},this._categories=[],this._framesById={},this._addCategories(o.s.DEFAULTS.FRAME_CATEGORIES);var i=this._options,r=i.categories,a=i.replaceCategories;this._options.categories?this._addCategories(r,a):this._updateAllCategory()}return a(e,[{key:"_addCategories",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._categories=n?e.slice(0):o.v.mergeCategories(this._categories,e,"frames"),this._categoriesById={},this._categories.forEach(function(e){t._categoriesById[e.identifier]=e});var i=this._options.availableFrames;i&&this._categories.forEach(function(e){e.frames=e.frames.filter(function(e){return-1!==i.indexOf(e.identifier)})}),this._categories.forEach(function(e){e.frames.forEach(function(e){t._framesById[e.identifier]=e})}),this._updateAllCategory()}},{key:"_updateAllCategory",value:function(){this._allCategory={identifier:"all",defaultName:"All",frames:this._categories.map(function(e){return e.frames}).reduce(function(e,t){return e.concat(t)},[])},this._categoriesById.all=this._allCategory}},{key:"getFramesForCategory",value:function(e){if(!this._categoriesById[e])throw new Error("Unknown frame category '"+e+"'");return this._categoriesById[e].frames}},{key:"getFrameByIdentifier",value:function(e){return this._framesById[e]}},{key:"getCategories",value:function(){return this._categories}},{key:"getCategory",value:function(e){return this._categoriesById[e]}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._overlays=o.s.DEFAULTS.OVERLAYS.slice(0),this._overlaysByIdentifier={},n.overlays&&(n.replaceOverlays?this._overlays=n.overlays:this._overlays=this._overlays.concat(n.overlays)),n.availableOverlays&&(this._overlays=this._overlays.filter(function(e){return-1!==n.availableOverlays.indexOf(e.identifier)})),this._overlays.forEach(function(e){i._overlaysByIdentifier[e.identifier]=e})}return a(e,[{key:"getOverlays",value:function(){return this._overlays}},{key:"getOverlayByIdentifier",value:function(e){return this._overlaysByIdentifier[e]}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=d.q.OptionType,m=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).call(this,n));return i._loaded=!1,i._loading=!1,i._ui=e,i._frame=d.q.Utils.deepClone(i._options),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.q.Configurable),h(t,[{key:"load",value:function(){var e=this;if(this._loaded)return u.a.resolve();if(this._loading)return u.a.reject(new Error("Called Frame#load while it's already loading"));this._loading=!0;var t=this._frame.imageGroups,n=[];return["top","left","right","bottom"].forEach(function(i){if(i in t){var r=t[i];["start","mid","end"].forEach(function(t){t in r&&n.push(e._loadPart(i,t))})}}),u.a.all(n).then(function(){e._loaded=!0,e._loading=!1}).catch(function(t){e._loaded=!1,e._loading=!1})}},{key:"_loadPart",value:function(e,t){var n=this;return new u.a(function(i,r){var o=n._frame.imageGroups[e][t],a=o;"string"!=typeof o&&"image"in o&&(a=o.image);var s=new window.Image;s.addEventListener("load",function(){"string"!=typeof o?n._frame.imageGroups[e][t].image=s:n._frame.imageGroups[e][t]=s,i(s)}),s.addEventListener("error",function(){r(new Error("Failed to load image at "+a))}),s.crossOrigin=n._ui.getEditor().getCrossOrigin(),s.src=n._ui.getAssetPath(a)})}},{key:"getFrame",value:function(){return this._frame}}]),t}();t.a=m,m.prototype.availableOptions={identifier:{type:_.STRING,required:!0},defaultName:{type:_.STRING},thumbnail:{type:_.STRING},tintable:{type:_.BOOLEAN,default:!1},layoutMode:{type:_.STRING,default:"horizontal-inside",available:["horizontal-inside","vertical-inside"]},imageGroups:{type:_.OBJECT,required:!0}}},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(82),g=n(128),y=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,m.a),v(t,[{key:"serialize",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(t.prototype.__proto__||h()(t.prototype),"serialize",this).call(this,n).then(function(t){return t.meta={platform:"html5",version:e._editor.getSDK().version,createdAt:_.r.ISODateString(new Date)},t.image=t.inputImage,delete t.inputImage,t})}},{key:"_serializeSticker",value:function(e,n){var i=b(t.prototype.__proto__||h()(t.prototype),"_serializeSticker",this).call(this,e,n);return i.options.alpha=n.getAlpha(),i.options.tintColor&&(i.options.tintColor={rgba:i.options.tintColor}),i}},{key:"_serializeText",value:function(e,n){var i=b(t.prototype.__proto__||h()(t.prototype),"_serializeText",this).call(this,e,n);return i.options.color={rgba:i.options.color},i.options.backgroundColor={rgba:i.options.backgroundColor},i.options.flipHorizontally=!1,i.options.flipVertically=!1,delete i.options.fontWeight,i}},{key:"_serializePath",value:function(e){var n=b(t.prototype.__proto__||h()(t.prototype),"_serializePath",this).call(this,e);delete n.hardness,delete n.size,delete n.color;var i=e.getBrush();n.brush=i.serializeOptions(["identifier","size","color"],!0),void 0===n.brush.identifier&&delete n.brush.identifier,n.brush.color={rgba:n.brush.color};var r=i.getOption("hardness");return"undefined"!==r&&(n.brush.hardness=r),n}},{key:"_serializeFrameOperation",value:function(e,n){b(t.prototype.__proto__||h()(t.prototype),"_serializeFrameOperation",this).call(this,e,n);var i=n.filter(function(e){return"sprite"===e.type});if(i.length){var r=i.pop().options.sprites.filter(function(e){return"frame"===e.type})[0];e.getTintColor().equals(new _.c(1,1,1,0))||(r.options.tintColor={rgba:e.serializeOption("tintColor",!0)});var o=e.serializeOptions(["scale","alpha"],!0);r.options=_.r.extend(r.options,o),r.options.size=r.options.scale,delete r.options.scale}}},{key:"_serializeTransformOperation",value:function(e){var n=b(t.prototype.__proto__||h()(t.prototype),"_serializeTransformOperation",this).call(this,e);if(e._ratio){var i=void 0;i=e._ratio instanceof g.a?e._ratio.getIdentifier():e._ratio.identifier,n.options.meta={identifier:i}}return delete n.options.scale,n}},{key:"_serializeAdjustmentsOperation",value:function(e){var n=b(t.prototype.__proto__||h()(t.prototype),"_serializeAdjustmentsOperation",this).call(this,e),i=e.availableOptions,r={};return["gamma","whites","blacks","temperature"].forEach(function(t){var n=i[t],o=e.getOption(t),a=n.minValue,s=n.midValue,l=n.maxValue;r[t]=o<=s?(o-a)/(s-a)-1:(o-s)/(l-s)}),n.options=y({},n.options,r),n}},{key:"_serializeOperation",value:function(e,n){switch(e.constructor.identifier){case"mirrored-focus":return this._serializeMirroredFocusOperation(e);case"linear-focus":return this._serializeLinearFocusOperation(e);case"blur":return this._serializeBlurOperation(e);default:return b(t.prototype.__proto__||h()(t.prototype),"_serializeOperation",this).call(this,e,n)}}},{key:"_serializeMirroredFocusOperation",value:function(e){return{type:"focus",options:{type:"mirrored",options:e.serializeOptions(["start","end","blurRadius","size","gradientSize"],!0)}}}},{key:"_serializeLinearFocusOperation",value:function(e){var t=e.serializeOptions(["controlPoint1","controlPoint2","blurRadius"],!0);return t.start=t.controlPoint1,delete t.controlPoint1,t.end=t.controlPoint2,delete t.controlPoint2,{type:"focus",options:{type:"linear",options:t}}}},{key:"_serializeBlurOperation",value:function(e){return{type:"focus",options:{type:"gaussian",options:e.serializeOptions(["blurRadius"],!0)}}}}]),t}();t.a=k,k.version="3.0.0"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(7);n.n(c);var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.Configurable),t}();t.a=u,u.prototype.availableOptions={identifier:{type:c.OptionType.STRING,required:!0},defaultName:{type:c.OptionType.STRING,required:!0},ratio:{type:c.OptionType.ALL,required:!1,default:null},selected:{type:c.OptionType.BOOLEAN,required:!1},dimensions:{type:c.OptionType.VECTOR2,required:!1},lockDimensions:{type:c.OptionType.BOOLEAN,required:!1,default:null},forceDimensions:{type:c.OptionType.BOOLEAN,required:!1,default:null}}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=_()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(d.a?d()(e,t):e.__proto__=t)}var a=n(9),s=n.n(a),l=n(0),c=n.n(l),u=n(6),f=n.n(u),p=n(2),d=n.n(p),h=n(3),_=n.n(h),m=n(8),g=n.n(m),y=n(1),v=n.n(y),b=n(4),k=n(83),w=n(54),S=n(33),C=n(25),E=n(26),x=s.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),c()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),O=function e(t,n,i){null===t&&(t=Function.prototype);var r=f()(t,n);if(void 0===r){var o=v()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},R=void 0;void 0!==b.q.Operations.SpriteOperation&&(R=b.q.Operations.SpriteOperation.BrushSprite.Brush);var D=function(e){function t(){return i(this,t),r(this,(t.__proto__||v()(t)).apply(this,arguments))}return o(t,k.a),T(t,[{key:"_deserializeSticker",value:function(e,t){var n=b.q.Operations.SpriteOperation,i=t.options,r=this._stickerManager.getStickerByIdentifier(i.identifier);if(!r)return b.h.warn("Deserializer","Unknown sticker `"+i.identifier+"`. Skipping sprite."),g.a.resolve();var o=r.images.mediaBase,a=w.a.getURLForSticker(r,"base"),s=o.rawData?o.uris[0]:this._editor.getUI().getAssetPath(a),l=e.getInputDimensions(!1);return C.a.load(s).then(function(t){var o=n.StickerSprite.prototype.availableOptions.adjustments.structure,a=i.rotation,s=i.flipHorizontally,c=i.flipVertically,u={identifier:i.identifier,image:t,position:b.w.fromObject(i.position),dimensions:b.w.fromObject(i.dimensions).multiply(l.min()),rotation:a||0,flipHorizontally:s,flipVertically:c,resizeMode:r.resizeMode||"keepAspect",adjustments:{}};return void 0!==i.adjustments&&["brightness","contrast","saturation"].forEach(function(e){void 0!==i.adjustments[e]&&(u.adjustments[e]=i.adjustments[e]+o[e].default)}),void 0!==i.tintColor&&void 0!==r.tintMode&&(u.tintColor=b.c.fromArray(i.tintColor.rgba),u.tintMode=r.tintMode),void 0!==i.alpha&&(u.alpha=i.alpha),e.createSticker(u)})}},{key:"_deserializeTransformOperation",value:function(e){return O(t.prototype.__proto__||v()(t.prototype),"_deserializeTransformOperation",this).call(this,e).then(function(e){if(e)return e._ratio=null,e})}},{key:"_deserializeInputImage",value:function(){var e=this,t=this._data.image,n=t.data,i=t.type,r=t.uri;return n&&i&&(r="data:"+i+";base64,"+n),r?C.a.load(r).then(function(t){e._editor.setImage(t)}):g.a.resolve()}},{key:"_deserializeAdjustmentsOperation",value:function(e){var n=b.q.Operations.AdjustmentsOperation;return O(t.prototype.__proto__||v()(t.prototype),"_deserializeAdjustmentsOperation",this).call(this,e).then(function(t){if(!t)return null;var i=e.options,r={};return["gamma","whites","blacks","temperature"].forEach(function(e){if(void 0!==i[e]){var t=n.prototype.availableOptions[e],o=t.minValue,a=t.midValue,s=t.maxValue,l=i[e];l=l<0?a+(a-o)*l:a+(s-a)*l,r[e]=l}}),t.set(r),t})}},{key:"_deserializeFocusOperation",value:function(e){var n=e.options.options;switch(e.options.type){case"radial":return O(t.prototype.__proto__||v()(t.prototype),"_deserializeFocusOperation",this).call(this,e);case"linear":var i=n.start,r=n.end,o=n.blurRadius;return g.a.resolve(this._editor.operations.getOrCreate("linear-focus",{controlPoint1:b.w.fromObject(i),controlPoint2:b.w.fromObject(r),blurRadius:o}));case"mirrored":var a=n.start,s=n.end,l=n.size,c=n.gradientSize,u=n.blurRadius;return g.a.resolve(this._editor.operations.getOrCreate("mirrored-focus",{start:b.w.fromObject(a),end:b.w.fromObject(s),size:l,gradientSize:c,blurRadius:u}));case"gaussian":var f=n.blurRadius;return g.a.resolve(this._editor.operations.getOrCreate("blur",{blurRadius:f}))}}},{key:"_deserializeText",value:function(e,t){var n=t.options,i=n.fontSize,r=n.lineHeight,o=n.fontIdentifier,a=n.alignment,s=n.rotation,l=n.maxWidth,c=n.color,u=n.backgroundColor,f=this._ui.getFontLoader(),p=this._fontManager.getVariationByIdentifier(o);return p?f.setFonts([p.getFont()]):p=this._fontManager.getDefaultVariation(),f.load().then(function(){var t=e.getInputDimensions(!1),o=l*t.min()/t.x,f=e.createText({fontSize:i,lineHeight:r,fontFamily:p.getFontFamily(),fontWeight:p.getFontWeight(),fontIdentifier:p.getIdentifier(),textMetrics:p.getTextMetrics(),alignment:a,rotation:s,maxWidth:o,text:n.text,color:b.c.fromArray(c.rgba),backgroundColor:b.c.fromArray(u.rgba),position:b.w.fromObject(n.position)});return f._edited=!0,f})}},{key:"_createBrushForPath",value:function(e){var t=e.brush,n=t.identifier,a=t.color,s=t.size,l=t.hardness,c={color:b.c.fromArray(a.rgba),size:s};void 0!==l&&(c.hardness=l);var u=this._brushManager.getBrushByIdentifier(n);if(u||(u=this._brushManager.getFirstBrush()),u.prototype&&u.prototype instanceof R)return new u(c);var f=b.r.extend({},u);delete f.image;var p=function(e){function t(){return i(this,t),r(this,(t.__proto__||v()(t)).apply(this,arguments))}return o(t,R),t}();return p.identifier=u.identifier,new p(b.r.extend({},f,c))}},{key:"_deserializeFrame",value:function(e,n){var i=this;return O(t.prototype.__proto__||v()(t.prototype),"_deserializeFrame",this).call(this,e,n).then(function(){var e=i._editor.operations.get("frame"),t=n.options,r=t.size,o=t.alpha,a=t.tintColor,s={};void 0!==r&&(s.scale=r),void 0!==o&&(s.alpha=o),void 0!==a&&(s.tintColor=b.c.fromArray(a.rgba)),e.set(s)})}},{key:"_deserializeTextDesign",value:function(e,t){var n=this,i=t.options,r=i.position,o=i.rotation,a=i.flipHorizontally,s=i.flipVertically,l=i.text,c=i.color,u=i.width,f=i.seed,p=i.inverted,d=i.identifier;d===b.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignBlocksLight.identifier?d=b.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignBlocksLightV310.identifier:d===b.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignSunshine.identifier&&(d=b.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignSunshineV310.identifier);var h=new S.a(this._ui,this._getOptions("textdesign")),_=new E.a(this._ui,{fonts:b.d.DEFAULTS.TEXT_DESIGN_FONTS,replaceFonts:!0}),m=e.constructor.TextDesignSprite.AssetManager,g=this._ui.getFontLoader(),y=new(h.getLayoutByIdentifier(d));return g.setFonts(_.getFonts()),m.setFonts(x({},m.getFonts(),_.getVariationsByIdentifier())),g.load().then(function(){var t=y.getImagePaths().map(function(e){return{path:e,fullPath:n._ui.getAssetPath(e),image:null}});return m.loadImages(t).then(function(){return y.onImagesLoaded(),e.createTextDesign({position:r,rotation:o,flipHorizontally:a,flipVertically:s,text:l,color:b.c.fromArray(c.rgba),width:u,seed:f,inverted:p,layout:y})})})}}]),t}();t.a=D,D.version="3.0.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=(n(4),n(127)),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.a),p(t,[{key:"_serializeTextDesign",value:function(e,t){var n=t.serializeOptions(["position","rotation","flipHorizontally","flipVertically","text","color","width","seed","inverted"],!0);n.color={rgba:n.color};var i=t.getLayout();return i&&(n.identifier=i.constructor.identifier),{type:"textdesign",options:n}}}]),t}();t.a=d,d.version="3.1.0"},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(129),_=n(33),m=n(26),g=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),y(t,[{key:"_deserializeTextDesign",value:function(e,t){var n=this,i=t.options,r=i.position,o=i.rotation,a=i.flipHorizontally,s=i.flipVertically,l=i.text,c=i.color,u=i.width,f=i.seed,p=i.inverted,h=i.identifier;h===d.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignBlocksLight.identifier?h=d.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignBlocksLightV310.identifier:h===d.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignSunshine.identifier&&(h=d.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignSunshineV310.identifier);var y=new _.a(this._ui,this._getOptions("textdesign")),v=new m.a(this._ui,{fonts:d.d.DEFAULTS.TEXT_DESIGN_FONTS,replaceFonts:!0}),b=e.constructor.TextDesignSprite.AssetManager,k=this._ui.getFontLoader(),w=new(y.getLayoutByIdentifier(h));return k.setFonts(v.getFonts()),b.setFonts(g({},b.getFonts(),v.getVariationsByIdentifier())),k.load().then(function(){var t=w.getImagePaths().map(function(e){return{path:e,fullPath:n._ui.getAssetPath(e),image:null}});return b.loadImages(t).then(function(){return w.onImagesLoaded(),e.createTextDesign({position:r,rotation:o,flipHorizontally:a,flipVertically:s,text:l,color:d.c.fromArray(c.rgba),width:u,seed:f,inverted:p,layout:w})})})}}]),t}();t.a=v,v.version="3.1.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(130),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.a),p(t,[{key:"_serializeTextDesign",value:function(e,t){var n=t.serializeOptions(["position","rotation","flipHorizontally","flipVertically","text","color","width","seed","inverted","padding"],!0);n.color={rgba:n.color};var i=t.getLayout();return i&&(n.identifier=i.constructor.identifier),n.padding*=n.width,{type:"textdesign",options:n}}}]),t}();t.a=d,d.version="3.2.0"},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(131),_=n(33),m=n(26),g=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),y(t,[{key:"_deserializeTextDesign",value:function(e,t){var n=this,i=t.options,r=i.position,o=i.rotation,a=i.flipHorizontally,s=i.flipVertically,l=i.text,c=i.color,u=i.width,f=i.seed,p=i.inverted,h=i.identifier;h===d.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignBlocksLight.identifier?h=d.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignBlocksLightV310.identifier:h===d.q.Operations.SpriteOperation.TextDesignSprite.Layouts.TextDesignSunshine.identifier&&(h=d.q.Operations.SpriteOperation.TextDesignSprite.LegacyLayouts.TextDesignSunshineV310.identifier);var y="padding"in i?i.padding/u:-1,v=new _.a(this._ui,this._getOptions("textdesign")),b=new m.a(this._ui,{fonts:d.d.DEFAULTS.TEXT_DESIGN_FONTS,replaceFonts:!0}),k=e.constructor.TextDesignSprite.AssetManager,w=this._ui.getFontLoader(),S=new(v.getLayoutByIdentifier(h));return w.setFonts(b.getFonts()),k.setFonts(g({},k.getFonts(),b.getVariationsByIdentifier())),w.load().then(function(){var t=S.getImagePaths().map(function(e){return{path:e,fullPath:n._ui.getAssetPath(e),image:null}});return k.loadImages(t).then(function(){return S.onImagesLoaded(),e.createTextDesign({position:r,rotation:o,flipHorizontally:a,flipVertically:s,text:l,color:d.c.fromArray(c.rgba),width:u,seed:f,inverted:p,layout:S,padding:y})})})}}]),t}();t.a=v,v.version="3.2.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(132),h=n(55),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.a),_(t,[{key:"_serializeOperation",value:function(e,n){switch(e.constructor.identifier){case"artfilter":return this._serializeStyle(e);default:return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_serializeOperation",this).call(this,e,n)}}},{key:"_serializeOrientationOperation",value:function(e){return{type:"orientation",options:e.serializeOptions(["flipVertically","flipHorizontally","rotation"],!0)}}},{key:"_serializeStyle",value:function(e){var t=e.getOptions(),n=t.identifier,i=t.intensity,r=t.blendMode,o=e.getStyleTransferModel().getOptions(),a=o.tileEdgeLength,s=o.overlappingFactor;return{type:"artFilter",options:{identifier:n,intensity:i,blendMode:h.a[r],tileEdgeLength:a,overlappingFactor:s}}}}]),t}();t.a=m,m.version="3.4.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(133),g=(n(33),n(26),n(136)),y=n(55),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=_.r.flipObject(y.a),k=_.q.Operations.ArtFilterOperation,w=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,m.a),v(t,[{key:"_deserializeOperation",value:function(e){return"artFilter"===e.type?this._deserializeStyle(e):function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"_deserializeOperation",this).call(this,e)}},{key:"_deserializeOrientationOperation",value:function(e){var t=e.options,n=this._editor.operations.getOrCreate("orientation");return n?(n.set(t),p.a.resolve(n)):p.a.resolve()}},{key:"_deserializeStyle",value:function(e){var t=this,n=e.options,i=n.identifier,r=n.intensity,o=n.blendMode,a=n.tileEdgeLength,s=n.overlappingFactor;return i?k.isSupported(this._editor.getSDK())?new g.a(this._ui,this._getOptions("artfilter")).instantiateStyleTransferModelForArtFilterWithIdentifier(i,{tileEdgeLength:a,overlappingFactor:s}).catch(function(e){_.h.warn("Could not deserialize art filter: "+e)}).then(function(e){t._editor.operations.getOrCreate("artfilter",{identifier:i,styleTransferModel:e,intensity:r,blendMode:parseInt(b[o||o],10)})}):(_.h.warn("Can't restore Art Filters, as they're not supported on this platform."),p.a.resolve()):(_.h.warn("Found invalid Art Filter serialization."),p.a.resolve())}}]),t}();t.a=w,w.version="3.4.0"},function(e,t,n){"use strict";var i=n(20),r=n.n(i),o=n(0),a=n.n(o),s=n(8),l=n.n(s),c=n(4),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),f=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ui=t,this._options=n,this._categoriesByIdentifier={},this._categories=[],this._artFiltersByIdentifier={},this._initCategories()}return u(e,[{key:"_initCategories",value:function(){var e=this,t={identifier:"standard",defaultName:"Standard",artFilters:c.s.DEFAULTS.ART_FILTERS||[]};if(this._categories=[t],this._options.categories&&(this._options.replaceCategories?this._categories=this._options.categories:this._categories=c.v.mergeCategories(this._categories,this._options.categories,"artFilters")),this._options.availableArtFilters){var n=[];this._categories.forEach(function(t){var i=t.artFilters.filter(function(t){return-1!==e._options.availableArtFilters.indexOf(t.identifier)});i.length>0&&n.push({identifier:t.identifier,defaultName:t.defaultName,artFilters:i})}),this._categories=n}var i={identifier:"all",defaultName:"All",artFilters:this._categories.length<=0?[]:this._categories.map(function(e){return e.artFilters}).reduce(function(e,t){return e.concat(t)})};this._categories.unshift(i),this._categoriesByIdentifier.all=i,this._categories.forEach(function(t){e._categoriesByIdentifier[t.identifier]=t}),i.artFilters.forEach(function(t){e._artFiltersByIdentifier[t.identifier]=t})}},{key:"instantiateStyleTransferModelForArtFilterWithIdentifier",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getArtFilterByIdentifier(e);if(!n)return l.a.reject(new Error("Unknown style with identifier `"+e+"`!"));var i=n.rootPath,r=this._ui.getEditor().getSDK(),o=r.getRenderer();t.weightURL=this._ui.getAssetPath(i+"/weights.json");var a=r.getInputTexture().getDimensions(),s=r.getOperationsStack().getByIdentifier("exif-orientation");return s&&(a=s.getNewDimensions(a)),c.q.Operations.ArtFilterOperation.StyleTransferModel.createWithOptions(t,a,o)}},{key:"updateLoadedModelWithWeightsForIdentifier",value:function(e,t){var n=this.getArtFilterByIdentifier(t);if(!n)return l.a.reject(new Error("Unknown style with identifier `"+t+"`!"));var i=n.rootPath,r=this._ui.getAssetPath(i+"/weights.json");return e.updateWithWeightsFromURL(r)}},{key:"getArtFiltersForCategory",value:function(e){if(!this._categoriesByIdentifier[e])throw new Error("Unknown art filter category '"+e+"'");return this._categoriesByIdentifier[e].artFilters}},{key:"getArtFilterByIdentifier",value:function(e){return this._artFiltersByIdentifier[e]}},{key:"getCategories",value:function(){return this._categories}},{key:"getArtFilters",value:function(){var e=this,t=[];return this._categories.map(function(n){t.push.apply(t,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return r()(e)}(e.getArtFiltersForCategory(n.identifier)))}),t}},{key:"getCategoryByIdentifier",value:function(e){return this._categoriesByIdentifier[e]}}]),e}();t.a=f},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(134),u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.a),t}();t.a=u,u.version="3.5.0"},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(135),_=n(33),m=n(26),g=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),y(t,[{key:"_deserializeTextDesign",value:function(e,t){var n=this,i=t.options,r=i.position,o=i.rotation,a=i.flipHorizontally,s=i.flipVertically,l=i.text,c=i.color,u=i.width,f=i.seed,p=i.inverted,h=i.identifier,y="padding"in i?i.padding/u:-1,v=new _.a(this._ui,this._getOptions("textdesign")),b=new m.a(this._ui,{fonts:d.d.DEFAULTS.TEXT_DESIGN_FONTS,replaceFonts:!0}),k=e.constructor.TextDesignSprite.AssetManager,w=this._ui.getFontLoader(),S=new(v.getLayoutByIdentifier(h));return w.setFonts(b.getFonts()),k.setFonts(g({},k.getFonts(),b.getVariationsByIdentifier())),w.load().then(function(){var t=S.getImagePaths().map(function(e){return{path:e,fullPath:n._ui.getAssetPath(e),image:null}});return k.loadImages(t).then(function(){return S.onImagesLoaded(),e.createTextDesign({position:r,rotation:o,flipHorizontally:a,flipVertically:s,text:l,color:d.c.fromArray(c.rgba),width:u,seed:f,inverted:p,layout:S,padding:y})})})}}]),t}();t.a=v,v.version="3.5.0"},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(137),m=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,_.a),g(t,[{key:"_serializeAdjustmentsOperation",value:function(e){var n=function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"_serializeAdjustmentsOperation",this).call(this,e),i={},r=e.availableOptions.sharpness,o=e.getOption("sharpness"),a=r.minValue,s=r.midValue,c=r.maxValue;return i.sharpness=o<=s?(o-a)/(s-a)-1:(o-s)/(c-s),n.options=m({},n.options,i),n}}]),t}();t.a=y,y.version="3.6.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(138),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"_deserializeAdjustmentsOperation",value:function(e){var n=d.q.Operations.AdjustmentsOperation;return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_deserializeAdjustmentsOperation",this).call(this,e).then(function(t){if(!t)return null;var i=e.options,r={};if(void 0!==i.sharpness){var o=n.prototype.availableOptions.sharpness,a=o.minValue,s=o.midValue,l=o.maxValue,c=i.sharpness;return c=c<0?s+(s-a)*c:s+(l-s)*c,r.sharpness=c,t.set(r),t}})}}]),t}();t.a=m,m.version="3.6.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=n(282),s=n(128),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._options=t,this._categoriesById={},this._categories=[],this._initCategories()}return l(e,[{key:"_initCategories",value:function(){var e=this,t=this._options,n=t.replaceCategories,i=t.categories,r=void 0===i?[]:i,l=o.v.cloneCategories(o.d.DEFAULTS.TRANSFORM_RATIO_CATEGORIES,"ratios");l=n?o.v.cloneCategories(r,"ratios"):o.v.mergeCategories(r,l,"ratios"),this._categories=l.map(function(e){var t=e.ratios,n=void 0===t?[]:t,i=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(e,["ratios"]),r=new a.a(i);return r.setRatios(n.map(function(e){var t=new s.a(e);return t.getDimensions()&&(null==t.getForceDimensions()&&t.setForceDimensions(!0),null==t.getLockDimensions()&&t.setLockDimensions(!0)),t})),r}),this._categoriesById={},this._categories.forEach(function(t){e._categoriesById[t.getIdentifier()]=t})}},{key:"getCategories",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._categories.slice(0);if(e){var n=new a.a({name:"all",ratios:this._categories.map(function(e){return e.getRatios()}).reduce(function(e,t){return e.concat(t)})});t.unshift(n)}return t}},{key:"getRatiosForCategory",value:function(e){var t=this._options.availableRatios;return t?e.getRatios().filter(function(e){return-1!==t.indexOf(e.getIdentifier())}):e.getRatios()}},{key:"hasRatioValue",value:function(e){var t=this,n=!1;return this._categories.forEach(function(i){t.getRatiosForCategory(i).forEach(function(t){if(t.getRatio())"*"===t.getRatio()?n=!0:t.getRatio()===e&&(n=!0);else if(t.getDimensions()){var i=t.getDimensions();i.y/i.x===e&&(n=!0)}})}),n}}]),e}();t.a=c},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(8),h=n.n(d),_=n(1),m=n.n(_),g=n(4),y=n(56),v=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},b=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||m()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onBackButtonClick"),o._needsStyleFixes=!0,o.state={backButton:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,y.a),b(t,[{key:"_onBackButtonClick",value:function(e){e.preventDefault()}},{key:"setSharedState",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=m()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||m()(t.prototype),"setSharedState",this).call(this,e,n),i&&this.props.controls.updateSharedState()}},{key:"fixStyles",value:function(){var e=this;return g.v.Browser.isIElte(10)?(this._table&&(this._table.style.height="100%"),this._container&&(this._container.style.height="100%"),new h.a(function(t){Object(g.A)(function(){if(e._root){var n=e._root.offsetHeight;if(e._container&&e._header){var i=e._header.offsetHeight;e._container.style.height=n-i+"px"}e._table&&(e._table.style.height=n+"px"),e._scrollbar&&e._scrollbar.update(),t()}},1e3)})):(this._scrollbar&&this._scrollbar.update(),h.a.resolve())}},{key:"_getRootProps",value:function(){return{}}},{key:"_renderContent",value:function(){return g.m.createElement("div",null)}},{key:"render",value:function(){var e=this,t=this.constructor.RootElement,n=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(this._getRootProps(),[]),i=this.context.screen.state.currentControl,r=null===i,o={backgroundImage:"url('"+this._getAssetPath("editor/controls/shared/back.png",!0)+"')"};return g.m.createElement(w,{innerRef:function(t){n.innerRef&&n.innerRef(t),e._root=t}},g.m.createElement(S,{innerRef:function(t){e._table=t}},!r&&g.m.createElement(C,{innerRef:function(t){e._header=t}},this.state.backButton&&g.m.createElement(T,{style:o,onClick:this._onBackButtonClick}),g.m.createElement(x,null,this._t("pesdk."+i+".title.name"))),g.m.createElement(E,null,g.m.createElement(t,v({},n,{innerRef:function(t){e._container=t},className:void 0}),this._renderContent()))))}},{key:"container",get:function(){return this._container}}]),t}();k.contextTypes=y.a.contextTypes,k.propTypes={options:g.k.object},t.a=k;var w=g.x.div("ykggfd","ControlsComponentRoot"),S=g.x.div("rfecls","ControlsComponentTable"),C=g.x.div("1tkmkv6","ControlsComponentHeader"),E=g.x.div("vkb8c9","RootElementContainer");k.RootElement=g.x.div("rfecls",{withBorderTop:"120drhm"},"ControlsComponent");var x=g.x.div("1ru8sfa","ControlsComponentTitle"),T=g.x.button("gyx1pn","BackButton")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"render",value:function(){var e=this.constructor.RootElement,t=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(this.props,[]);return f.m.createElement(e,t)}}]),t}();d.contextTypes=f.b.contextTypes,t.a=d,d.RootElement=f.x.li("11o197p",{disabled:"16s6vgr"},"CanvasHeaderButtonComponent")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(32),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(44),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).call(this));return n._input=e,n._onFileChange=n._onFileChange.bind(n),n._input.addEventListener("change",n._onFileChange),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.e),_(t,[{key:"open",value:function(){this._input.value=null,this._input.click()}},{key:"_handleFiles",value:function(e){var t=this,n=[],i=e.length,r=function(){0==(i-=1)&&t.emit("files",n)},o=!0,a=!1,s=void 0;try{for(var l,c=u()(e);!(o=(l=c.next()).done);o=!0)!function(e){var i=new window.FileReader;i.onload=function(i){var o=i.target.result,a=new window.Image;a.addEventListener("load",function(){n.push({image:a,name:e.name||""}),r()}),a.addEventListener("error",function(e){return r(),h.a.instance.displayError(t._t("errors.title"),t._t("errors.imageLoadingError.text"))}),a.src=o},i.readAsDataURL(e)}(l.value)}catch(e){a=!0,s=e}finally{try{!o&&c.return&&c.return()}finally{if(a)throw s}}}},{key:"_onFileChange",value:function(){var e=this._input.files;e.length&&this._handleFiles(e)}},{key:"dispose",value:function(){this._input.removeEventListener("change",this._onFileChange)}}]),t}();t.a=m},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(21),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKnobDragStart","_onKnobDrag","_onKnobDragStop","_onBarDragStart","_onBarDrag","_onBarDragStop"),o.state={value:o.props.value||0,sliderPosition:0,foregroundLeft:0,foregroundWidth:0},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),d(t,[{key:"componentDidMount",value:function(){var e=this;Object(f.A)(function(){e._setValue(e.state.value,!1)})}},{key:"componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this._setValue(e.value,!1)}},{key:"_onKnobDragStart",value:function(e){this._previousValue=this.state.value,this._initialSliderPosition=this.state.sliderPosition,this._initialPosition=e}},{key:"_onKnobDrag",value:function(e){var t=this._bar.offsetWidth,n=this._initialSliderPosition+e.x,i=(n=Math.max(0,Math.min(n,t)))/t,r=this.props.minValue+(this.props.maxValue-this.props.minValue)*i;this._setValue(r)}},{key:"_onKnobDragStop",value:function(){this._setValue(this.state.value,!0,!0)}},{key:"_onBarDragStart",value:function(e){this._previousValue=this.state.value,this._initialPosition=e.clone();var t=this._bar.offsetWidth,n=e.x/t,i=this.props.minValue+(this.props.maxValue-this.props.minValue)*n;this._setValue(i)}},{key:"_onBarDrag",value:function(e){var t=this._initialPosition.clone().add(e),n=this._bar.offsetWidth,i=t.x/n,r=this.props.minValue+(this.props.maxValue-this.props.minValue)*i;r=Math.max(this.props.minValue,Math.min(this.props.maxValue,r)),this._setValue(r)}},{key:"_onBarDragStop",value:function(){this._setValue(this.state.value,!0,!0)}},{key:"_getKnobStyle",value:function(){return{left:this.state.sliderPosition}}},{key:"_getForegroundStyle",value:function(){return{left:this.state.foregroundLeft,width:this.state.foregroundWidth}}},{key:"_setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.props,r=i.minValue,o=i.maxValue,a=Math.min(Math.max((e-r)/(o-r),0),1),s=this._bar.offsetWidth,l=s*a,c=a*s,u=0;this.props.middleDot&&(c=Math.abs(a-.5)*s,u=a<.5?.5*s-c:"50%"),this.setState({value:e,sliderPosition:l,foregroundWidth:c,foregroundLeft:u}),t&&this.props.onChange&&this.props.onChange(e,this._previousValue,n)}},{key:"_buildValue",value:function(e){return e%1!=0&&(e=e.toFixed(2)),this.props.positiveValuePrefix&&e>=0&&(e=""+this.props.positiveValuePrefix+e),this.props.valueUnit&&(e+=this.props.valueUnit),e}},{key:"render",value:function(){var e=this,t={style:this._getForegroundStyle()},n=this.props.idleValue,i=(void 0===n?this.props.minValue:n)===this.state.value;return f.m.createElement(_,{disabled:this.props.disabled},f.m.createElement(p.a,{onStart:this._onBarDragStart,onDrag:this._onBarDrag,onStop:this._onBarDragStop,disabled:this.props.disabled},f.m.createElement(w,null,f.m.createElement(m,{ref:"foo",innerRef:function(t){e._bar=t}},f.m.createElement("div",null,f.m.createElement(y,{darkBackground:this.props.darkBackground}),f.m.createElement(v,t),f.m.createElement(p.a,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag,onStop:this._onKnobDragStop,disabled:this.props.disabled},f.m.createElement(k,{style:this._getKnobStyle(),className:void 0},f.m.createElement(b,{idle:i}))))))))}}]),t}();h.propTypes={value:f.k.number.isRequired,minValue:f.k.number.isRequired,maxValue:f.k.number.isRequired,idleValue:f.k.number,middleDot:f.k.bool,onChange:f.k.func,positiveValuePrefix:f.k.string,valueUnit:f.k.string,label:f.k.string},h.contextTypes=f.b.contextTypes,t.a=h;var _=f.x.div("jc3w8i",{disabled:"1voy7lm"},"Slider"),m=f.x.div("1pvw1zw","Bar"),g=f.x.div("8gacw5","BarSection"),y=Object(f.x)(g)("120drhm",{darkBackground:"120drhm"},"BarBackgroundSection"),v=Object(f.x)(g)("1apine2","BarForegroundSection"),b=f.x.div("8i3bvo",{idle:"6eg4rp"},"Knob"),k=f.x.div("1x3cm77","KnobTouchTarget"),w=f.x.div("1ssoezr","BarContainer")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"ControlGroupList",function(){return r}),n.d(t,"ControlGroup",function(){return o}),n.d(t,"ControlGroupTitle",function(){return a});var i=n(4),r=i.x.css("1f3fuxn","ControlGroupList"),o=i.x.css("1bxndxk","ControlGroup"),a=i.x.css("12fzsea","ControlGroupTitle")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"render",value:function(){var e=this._getAssetPath("editor/controls/shared/checkbox.png",!0),t=this._getAssetPath("editor/controls/shared/checkbox-active.png",!0),n=this.props,i=n.styles,r=n.className,o=n.checked,a=n.onClick;return f.m.createElement(h,{styles:i,className:r,onClick:a,style:{backgroundImage:"url("+(o?t:e)+")"}})}}]),t}();t.a=d;var h=f.x.div("5nuoh","Checkbox");d.RootElement=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(87),d=n(57),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.a),h(t,[{key:"_renderRightPart",value:function(){var e=this,t=[];return this.props.inputClassName&&t.push(this.props.inputClassName),f.m.createElement(m,{value:this.state.value,onLiveChange:this._onInputLiveChange,onChange:this._onInputChange,className:t.join(" "),innerRef:function(t){e._input=t},disabled:this.props.disabled})}},{key:"render",value:function(){var e=this.props,t=e.inputLabel,n=e.className,i=e.disabled,r=e.styles;return f.m.createElement(g,{styles:r,className:n,disabled:i},f.m.createElement(y,null,f.m.createElement(v,null,t&&f.m.createElement(b,null,t||" "),this._renderRightPart())))}}]),t}();_.contextTypes=p.a.contextTypes,t.a=_;var m=Object(f.x)(d.a)("12dz026","InputField"),g=Object(f.x)(p.a.RootElement)("9ngfap","ColorComponentInput"),y=f.x.div("15u7gri","Row"),v=f.x.div("1hy9z1m",{bottomAligned:"17xdalt"},"Column"),b=f.x.div("szltve","Title")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.PlainControlItem,h=f.ControlsStyles.PlainControlItemBackground,_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onWebcamClick","_onDropZoneClick","_onDropZoneDragEnter","_onDropZoneDragLeave","_onDropZoneDragOver","_onDropZoneDrop","_onImage"),o._dragCounter=0,o.state={dropZoneHovered:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"_onWebcamClick",value:function(){this.props.onWebcamActivated&&this.props.onWebcamActivated()}},{key:"_onImage",value:function(e){this.props.onImage&&this.props.onImage(e)}},{key:"_onDropZoneClick",value:function(){this.refs.upload.open()}},{key:"_onDropZoneDragEnter",value:function(e){e.preventDefault(),this._dragCounter++,this.setState({dropZoneHovered:!0})}},{key:"_onDropZoneDragLeave",value:function(e){e.preventDefault(),0===--this._dragCounter&&this.setState({dropZoneHovered:!1})}},{key:"_onDropZoneDragOver",value:function(e){e.preventDefault()}},{key:"_onDropZoneDrop",value:function(e){var t=this;e.stopPropagation(),e.preventDefault(),(e=e.nativeEvent).returnValue=!1,this.setState({dropZoneHovered:!1},function(){if(e.target||e.dataTransfer){var n=e.target.files||e.dataTransfer.files;if(n&&!(n.length<=0))return n[0].type.match(/^image\//i)?void t._handleFile(n[0]):f.ModalManager.instance.displayError(t._t("pesdk.common.title.error"),t._t("pesdk.editor.text.invalidFileTypeError",{fileType:n[0].type}))}})}},{key:"_handleFile",value:function(e){var t=this,n=new window.FileReader;n.onload=function(e){var n=e.target.result,i=new window.Image;i.addEventListener("load",function(){t._onImage(i)}),i.addEventListener("error",function(e){return f.ModalManager.instance.displayError(t._t("pesdk.common.title.error"),t._t("pesdk.editor.text.imageLoadingError"))}),i.crossOrigin=t.context.editor.getCrossOrigin(),i.src=n},n.readAsDataURL(e)}},{key:"render",value:function(){var e={backgroundImage:"url('"+this._getAssetPath("editor/controls/library/webcam.png",!0)+"')"};return f.React.createElement(m,null,f.React.createElement(f.InvisibleUploadComponent,{ref:"upload",onNewFile:this._onImage}),f.React.createElement(g,null,f.React.createElement(y,{onClick:this._onDropZoneClick,onDragEnter:this._onDropZoneDragEnter,onDragOver:this._onDropZoneDragOver,onDragLeave:this._onDropZoneDragLeave,onDrop:this._onDropZoneDrop,hovered:this.state.dropZoneHovered},this.state.dropZoneHovered?this._t("pesdk.library.button.fileDropZoneHovered"):this._t("pesdk.library.button.fileDropZone")),!this.state.dropZoneHovered&&this.props.webcamEnabled&&f.React.createElement(v,{style:e,className:void 0,onClick:this._onWebcamClick})))}}]),t}();t.a=_;var m=Object(f.adonis)(d).li("fujban","Container"),g=Object(f.adonis)(h).div("17hsmc4","Background"),y=f.adonis.div("yw0i2r",{hovered:"1xndhux"},"DropZone"),v=f.adonis.div("1y2fyfw","WebcamButton")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=n.n(f),d=n(353),h=n(355),_=n(4),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseControls),m(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n=this.context.editor,i=t.FOCUS_OPERATIONS.map(function(t){return e.get(t)}).reduce(function(e,t){return e||t}),r=i&&i.getInputDimensions(!1),o=i?i.constructor.identifier:null,a=t.getItemByOperationIdentifier(o),s=a?a.identifier:"none";if(n&&i){var l=n.getOptions(),c=_.r.defaults(l.editor.controlsOptions.focus,this.defaultOptions);i._options.highQualityCanvasBlur=c.highQualityCanvasBlur}return{operation:i||null,inputDimensions:r,operationIdentifier:o,selectedFocus:s,selectedFocusItem:a,blurRadius:i?i.getBlurRadius():0,linearFocus:"linear-focus"===o?{controlPoint1:i.getControlPoint1(),controlPoint2:i.getControlPoint2()}:null,mirroredFocus:"mirrored-focus"===o?{start:i.getStart(),end:i.getEnd(),size:i.getSize(),gradientSize:i.getGradientSize()}:null,radialFocus:"radial-focus"===o?{position:i.getPosition(),radius:i.getRadius(),gradientRadius:i.getGradientRadius()}:null,setSelectedFocus:function(t){t.operationIdentifier!==o&&(o&&e.remove(o),t.operationIdentifier&&e.getOrCreate(t.operationIdentifier))},setBlurRadius:function(e){i&&i.setBlurRadius(e)},setControlPoint1:function(e){"linear-focus"===o&&i.setControlPoint1(e)},setControlPoint2:function(e){"linear-focus"===o&&i.setControlPoint2(e)},setStart:function(e){"mirrored-focus"===o&&i.setStart(e)},setEnd:function(e){"mirrored-focus"===o&&i.setEnd(e)},setPosition:function(e){"radial-focus"===o&&i.setPosition(e)},setRadius:function(e){"radial-focus"===o&&i.setRadius(e)},setOperationOptions:function(e){i&&i.set(e)}}}},{key:"_onEnter",value:function(){var e=this.context.editor;e.zoom.auto(!0,!1,function(){e.features.disable("zoom","drag")},!1)}},{key:"_onLeave",value:function(){this.context.editor.features.enable("zoom","drag")}}],[{key:"getPreloadAssets",value:function(e){var t=[];return this.ITEMS.forEach(function(e){t.push(e.backgroundImagePath),t.push(e.activeBackgroundImagePath)}),t}},{key:"isEnabled",value:function(e){return e.isToolAllowed("focus")&&e.isToolEnabled("focus")}},{key:"getItemByIdentifier",value:function(e){return t.ITEMS.filter(function(t){return t.identifier===e})[0]}},{key:"getItemByOperationIdentifier",value:function(e){return t.ITEMS.filter(function(t){return t.operationIdentifier===e})[0]}}]),t}();g.clickAtPosition=f.BaseControls.clickAtPosition,g.ITEMS=[{identifier:"none",operationIdentifier:null,backgroundImagePath:"editor/controls/focus/none.jpg",activeBackgroundImagePath:"editor/controls/focus/none-active.jpg"},{identifier:"radial",operationIdentifier:"radial-focus",backgroundImagePath:"editor/controls/focus/radial.jpg",activeBackgroundImagePath:"editor/controls/focus/radial-active.jpg"},{identifier:"mirrored",operationIdentifier:"mirrored-focus",backgroundImagePath:"editor/controls/focus/mirrored.jpg",activeBackgroundImagePath:"editor/controls/focus/mirrored-active.jpg"},{identifier:"linear",operationIdentifier:"linear-focus",backgroundImagePath:"editor/controls/focus/linear.jpg",activeBackgroundImagePath:"editor/controls/focus/linear-active.jpg"},{identifier:"gaussian",operationIdentifier:"blur",backgroundImagePath:"editor/controls/focus/gaussian.jpg",activeBackgroundImagePath:"editor/controls/focus/gaussian-active.jpg"}],g.FOCUS_OPERATIONS=g.ITEMS.map(function(e){return e.operationIdentifier}).filter(function(e){return e}),g.identifier="focus",g.controlsComponent=d.a,g.canvasControlsComponent=h.a,g.iconPath="editor/controls/focus/icon.png",g.activeIconPath="editor/controls/focus/icon-active.png",g.defaultOptions={availableModes:null,highQualityCanvasBlur:!1},g.requiredOperations=g.ITEMS.map(function(e){return e.operationIdentifier}).filter(function(e){return e}),g.updatableOperations=g.ITEMS.map(function(e){return e.operationIdentifier}).filter(function(e){return e}),g.switchToDefaultControlsOnRemoval=!1,p.a.Controls.FocusControls=g,t.a=g},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.PlainControlItem,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.SharedStateComponent),p(t,[{key:"_onStickerClick",value:function(e){this.props.onStickerClick&&this.props.onStickerClick(e)}},{key:"_renderListItems",value:function(){var e=this,t=this.props.stickers,n=void 0,i=this.sharedState.selectedSprite;return i&&(n=i.getIdentifier()),t.map(function(t){var i="",r=t.images.mediaThumb;if(r.rawData)i=r.uris[0];else{var o=f.StickerManager.getURLForSticker(t,"thumb");i=e._getAssetPath(o)}var a=e.context.editor.getCrossOrigin();return f.React.createElement(m,{selected:t.identifier===n,key:t.identifier,onClick:e._onStickerClick.bind(e,t),className:void 0,threeColumns:!0},f.React.createElement(g,{crossOrigin:a,src:i}))})}},{key:"render",value:function(){return f.React.createElement(_,null,this._renderListItems())}}]),t}();h.contextTypes=f.SharedStateComponent.contextTypes,t.a=h;var _=f.adonis.ul("18qztam","StickerList"),m=Object(f.adonis)(d).li("m4lnou","StickerListItem"),g=f.adonis.img("1382xgm","StickerImage")},function(e,t,n){var i=n(7),r=n(5);n(323),i.UI.DesktopUI=r,e.exports=r},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(4),_=n(232),m=n(85),g=n(52),y=n(145),v=n(95),b=n(289),k=n(290),w=n(81),S=n(291),C=n(292),E=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),x=function(e){return h.r.byteArrayToString(h.a.decode(e))};Object(b.a)(h.x,".pesdk-desktop-editor"),Object(k.a)(h.x);var T=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=r(this,(t.__proto__||d()(t)).call(this));return n._mediator=new h.e,n._fontLoader=new w.a(n),n._options=e,n._initOptions(),n._initLanguage(),n._initEvents(),n._disposed=!1,n._preloader=new S.a(n,n._options,n._mediator),n._globalState=new h.t,n._isReady=!1,n._mediator.once(h.d.EVENTS.EDITOR_READY,function(){n._isReady=!0}),h.h.setLevel(n._options.logLevel),n._options.autoRun&&n.run(),n}return o(t,h.e),E(t,[{key:"run",value:function(){return!this._options.license||this._v()?(this._theme=this._options.theme,this._injectWebFonts(),this._options.container&&(this._options.container.style.position="relative",this._options.container.className+=" pesdk-desktop-editor"),this._render()):null}},{key:"_render",value:function(){var e=this,t=h.m.createElement(_.a,{ui:this,mediator:this._mediator,ref:function(t){e._component=t},options:this._options,globalState:this._globalState});if(this._options.renderReturnsComponent)return t;h.n.render(t,this._options.container)}},{key:"export",value:function(){var e;return(e=this.getEditor()).export.apply(e,arguments)}},{key:"save",value:function(){var e;return(e=this.getEditor()).save.apply(e,arguments)}},{key:"serialize",value:function(){var e;return(e=this.getEditor()).serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return this.getEditor().deserialize(e)}},{key:"getEditor",value:function(){return this._component.getEditor()}},{key:"isReady",value:function(){return this._isReady}},{key:"onReady",value:function(e){this._isReady?e():this._mediator.once(h.d.EVENTS.EDITOR_READY,e)}},{key:"_initOptions",value:function(){if(this._options=h.r.defaults(this._options,{language:"en",logLevel:"warn",crossOrigin:"anonymous",editor:{},assets:{},responsive:!1,preloader:!0,theme:v.a,autoRun:!0}),this._options.editor=h.r.defaults(this._options.editor||{},{enableZoom:!0,enableDrag:!0,enableExport:!0,enableKeyboardControls:!0,enablePositionSnapping:!0,enableRotationSnapping:!0,enableSave:!1,enableLoad:!1,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,preferredRenderer:"webgl",transparent:!0,clearColor:[0,0,0,0],displayResizeMessage:!0,maxMegaPixels:{},displayCloseButton:!1,undoMode:"global",defaultControl:"filter",forceCrop:!1,snappingOptions:{},tools:["transform","filter","adjustments","focus","text","textdesign","sticker","brush","frame","overlay","library","artfilter"],controlsOrder:[["library"],["artfilter","transform","filter","adjustments","focus"],["text","textdesign","sticker","brush","frame","overlay"]],operationsOrder:["exif-orientation","artfilter","orientation","transform","filter","adjustments","radial-focus","mirrored-focus","linear-focus","blur","selective-blur","overlay","sprite","frame","watermark"],controlsOptions:{focus:{highQualityCanvasBlur:!1}}}),this._options.editor.snappingOptions=h.r.defaults(this._options.editor.snappingOptions,{position:{},rotation:{}}),this._options.editor.snappingOptions.position=h.r.defaults(this._options.editor.snappingOptions.position,{padding:{},threshold:20}),this._options.editor.snappingOptions.position.padding=h.r.defaults(this._options.editor.snappingOptions.position.padding,{left:.1,right:.1,top:.1,bottom:.1}),this._options.editor.snappingOptions.rotation=h.r.defaults(this._options.editor.snappingOptions.rotation,{angles:[0,45,90,135,180,225,270,315],threshold:20}),this._options.editor.controlsOptions.focus=h.r.defaults(this._options.editor.controlsOptions.focus,{highQualityCanvasBlur:!1}),this._options.editor.maxMegaPixels=h.r.defaults(this._options.editor.maxMegaPixels,{mobile:5,desktop:10}),this._options.editor.export=h.r.defaults(this._options.editor.export||{},{format:"image/png",type:h.p.IMAGE,download:!0,fileBasename:"photoeditorsdk-export",quality:.8}),this._options.editor.save=h.r.defaults(this._options.editor.save||{},{format:"text/json",download:!0,fileBasename:"photoeditorsdk-save"}),this._options.extensions=h.r.defaults(this._options.extensions||{},{languages:{},operations:[],controls:[]}),this._options.assets=h.r.defaults(this._options.assets||{},{baseUrl:"assets",resolver:null}),!(this._options.editor.image instanceof window.Image)){var e=new window.Image;e.src=this._options.editor.image,this._options.editor.image=e}}},{key:"_injectWebFonts",value:function(){var e=[];for(var t in this._theme.fonts){var n=this._theme.fonts[t],i=this.getAssetPath(n.src,!0,!0);e.push('\n        @font-face {\n          font-family: "'+n.fontFamily+"\";\n          src: url('"+i+"') format('woff');\n          font-weight: "+n.fontWeight+";\n          font-style: "+n.fontStyle+";\n        }\n      ")}var r="\n      /* Injected by PhotoEditorSDK */\n      "+e.join("\n")+"\n    ";h.x.global(r,!0)}},{key:"_v",value:function(){return!!this[x("X29wdGlvbnM=")][x("bGljZW5zZQ==")]||(h.h.error(x("TGljZW5zaW5n"),x("Tm8gYGxpY2Vuc2VgIG9wdGlvbiBnaXZlbg==")),h.h.error(x("TGljZW5zaW5n"),x("SW4gY2FzZSB5b3UgZG9uJ3QgaGF2ZSBhIGxpY2Vuc2UgeWV0LCBwbGVhc2UgY29udGFjdCBvdXIgc2FsZXMgc3RhZmYgYXQgc2FsZXNAcGhvdG9lZGl0b3JzZGsuY29tIHRvIG9idGFpbiBhIGxpY2Vuc2Ugb3IgbG9nIGluIHRvIHlvdXIgY3VzdG9tZXIgZGFzaGJvYXJkLg==")),!1)}},{key:"_initEvents",value:function(){this._mediator.pipeEvents(this)}},{key:"_disposeEvents",value:function(){this._mediator.unpipeEvents(this)}},{key:"_initLanguage",value:function(){this._languages=h.r.deepDefaults(this._options.extensions.languages,{de:n(321),en:n(322)}),this._language=this._languages[this._options.language],this._language||h.h.error(this.constructor.name,"Language `"+this._options.language+"` not found!")}},{key:"translate",value:function(e,t){return h.v.translate(this._language,e,t)}},{key:"setImage",value:function(e){this._component&&this._component.setImage(e)}},{key:"getAssetPath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this._options.assets,r=i.baseUrl,o=i.resolver,a=r+"/"+e;return e.match(/(ftp|http|https):\/\//)&&(a=e),t&&(n||("undefined"!=typeof window&&window.devicePixelRatio||1)>1&&(e=e.replace(/\.[\w?=]+$/,function(e){return"@2x"+e})),a=r+"/ui/desktop/"+e),void 0!==o&&null!==o&&(a=o(a)),a}},{key:"getTheme",value:function(){return this._theme}},{key:"getFontLoader",value:function(){return this._fontLoader}},{key:"getPreloader",value:function(){return this._preloader}},{key:"dispose",value:function(){if(this._disposed)throw new Error("This instance of PhotoEditorSDK is already disposed.");this._disposed=!0,this._options.renderReturnsComponent||h.n.unmountComponentAtNode(this._options.container),this._disposeEvents()}}]),t}();T.prototype.identifier="desktop",T.BaseComponent=h.b,T.React=h.m,T.adonis=h.x,T.SharedState=h.t,T.Constants=h.d,T.Events=h.d.EVENTS,T.Utils=h.v,T.ScrollbarComponent=m.a,T.JSONLoader=g.a,T.SliderComponent=y.a;var O=function(e){function t(){return i(this,t),r(this,(t.__proto__||d()(t)).apply(this,arguments))}return o(t,h.m.Component),E(t,[{key:"componentDidMount",value:function(){this._ui=new T(h.r.extend({},this.props,{container:this.refs.container})),this.props.onEditorReady&&this._ui.onReady(this.props.onEditorReady)}},{key:"render",value:function(){var e=h.r.extend({},this.props.style||{});return h.m.createElement("div",{style:e,ref:"container"})}},{key:"ui",get:function(){return this._ui}}]),t}();for(var R in T.ReactComponent=O,T.Controls={},C)T[R]=C[R];h.q.UI=h.q.UI||{},h.q.UI.DesktopUI=T,t.default=T},function(e,t,n){n(155);var i=n(10).Object;e.exports=function(e,t,n){return i.defineProperty(e,t,n)}},function(e,t,n){var i=n(11);i(i.S+i.F*!n(18),"Object",{defineProperty:n(16).f})},function(e,t,n){n(157),e.exports=n(10).Object.setPrototypeOf},function(e,t,n){var i=n(11);i(i.S,"Object",{setPrototypeOf:n(158).set})},function(e,t,n){var i=n(17),r=n(14),o=function(e,t){if(r(e),!i(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,i){try{(i=n(27)(Function.call,n(63).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:i(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){n(160);var i=n(10).Object;e.exports=function(e,t){return i.create(e,t)}},function(e,t,n){var i=n(11);i(i.S,"Object",{create:n(65)})},function(e,t,n){var i=n(16),r=n(14),o=n(29);e.exports=n(18)?Object.defineProperties:function(e,t){r(e);for(var n,a=o(t),s=a.length,l=0;s>l;)i.f(e,n=a[l++],t[n]);return e}},function(e,t,n){var i=n(19),r=n(66),o=n(163);e.exports=function(e){return function(t,n,a){var s,l=i(t),c=r(l.length),u=o(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var i=n(67),r=Math.max,o=Math.min;e.exports=function(e,t){return(e=i(e))<0?r(e+t,0):o(e,t)}},function(e,t,n){n(165),e.exports=n(10).Object.getPrototypeOf},function(e,t,n){var i=n(38),r=n(94);n(48)("getPrototypeOf",function(){return function(e){return r(i(e))}})},function(e,t){e.exports=n},function(e,t,n){"use strict";function i(){}function r(){}var o=n(168);r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports={primaryColor:"#2D7BFF",primaryColorRGB:"45, 123, 255",backgroundColor:"#141415",backgroundColorRGB:"20, 20, 21",controlsKnobColor:"white",controlsBackgroundColor:"#232326",controlsBackgroundColorRGB:"35, 35, 38",controlsLightBackgroundColor:"#2a2a2e",controlsOutlineColor:"rgba(255, 255, 255, 0.6)",controlsSeparatorColor:"#1b1b1d",navigationBackgroundColor:"#202022",navigationBackgroundColorRGB:"32, 32, 34",textColor:"#FFFFFF",dimmedTextColor:"#888888",dimmedTextColorRGB:"136, 136, 136",filterItemBackgroundColor:"#4b4b4c",secondaryControlsBackgroundColor:"#2a2a2e",secondaryControlsBackgroundColorRGB:"42, 42, 46",focusItemBackgroundColor:"#343437",sliderBackgroundColor:"rgba(255,255,255,0.24)",darkSliderBackgroundColor:"#1B1B1E",sliderKnobColor:"#b5b5be",sliderCircleKnobColor:"#c8c8d2",highlightColor:"#2675F8",highlightColorRGB:"38, 117, 253",darkHighlightColorRGB:"15, 47, 101",buttonBorderColor:"#303034",defaultShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.60)",inputModalButtonBarColor:"#262629",snappingGuide:"#FF00FF",rotationSnappingGuide:"#00FFFF",modalErrorColor:"#C23A3A",modalWarningColor:"#C18226",modalLoadingColor:"#2D7BFF",zIndex:function(e){return 5*["background","controls","controlsOverlays","overlays","navigation"].indexOf(e)},defaultBorderRadius:"4px",transitionDuration:.3,listItemSlideInDelay:100,scrollbarGradientSize:64,uppercaseBoldFontFamily:"sourcesansprobold",uppercaseSemiBoldFontFamily:"sourcesansprosemibold",regularFontFamily:"firasansregular",mediumFontFamily:"firasansmedium",fonts:{firasansmedium:{fontFamily:"firasansmedium",fontWeight:"500",fontStyle:"normal",src:"fonts/FiraSans-Medium.woff"},firasansregular:{fontFamily:"firasansregular",fontWeight:"400",fontStyle:"normal",src:"fonts/FiraSans-Regular.woff"},sourcesansprobold:{fontFamily:"sourcesansprobold",fontWeight:"bolder",fontStyle:"normal",src:"fonts/SourceSansPro-Bold.woff"},sourcesansprosemibold:{fontFamily:"sourcesansprosemibold",fontWeight:"bold",fontStyle:"normal",src:"fonts/SourceSansPro-Semibold.woff"}}}},function(e,t,n){!function(t,i){e.exports=function(e){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeProvider=t.withTheme=void 0;var r=i(n(1)),o=i(n(27)),a=i(n(28)),s=i(n(29)),l=i(n(30));t.default=function(e){var t=new r.default(e),n=function(e){if(e instanceof a.default){var n=e,i={};return o.default.forEach(function(e){i[e]=function(i,r,o){return"string"==typeof r&&(o=r,r=void 0),t.createComponent(e,{styles:i,variations:r,name:o,baseStyles:n})}}),i}return function(n,i,r){return"string"==typeof i&&(r=i,i=void 0),t.createComponent(e,{styles:n,variations:i,name:r})}};return o.default.forEach(function(e){n[e]=function(n,i,r){return"string"==typeof i&&(r=i,i=void 0),t.createComponent(e,{styles:n,variations:i,name:r})}}),n.global=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t.getOptions(),r=i.injection,o=i.theme;if(r||n){"function"==typeof e&&(e=e(o));var a=t.getStylesBuffer();a.bufferCSS(e),a.flushToStyleTag(n)}},n.css=function(e,n,i){return"string"==typeof n&&(i=n,n=void 0),new a.default(t,{styles:e,variations:n,name:i||"baseStyles"})},["renderToStatic"].forEach(function(e){n[e]=t[e].bind(t)}),n},t.withTheme=s.default,t.ThemeProvider=l.default},function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=i(n(3)),a=i(n(5)),s=n(4),l=void 0!==e&&"production"===e.env.NODE_ENV,c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._options=(0,s.defaults)(t,{injection:!0,batchInjection:!0,minified:!1,autoPrefix:!0,cssSelectorPrefix:"",classNamePrefix:"",hashSeparator:"-",nameSeparator:"__",variationSeparator:"--",styleNode:null,injectionMode:l?"fast":"debug",hashedStyles:!1}),this._stylesBuffer=new o.default(this),this._componentFactory=new a.default(this,this._options)}return r(e,[{key:"createComponent",value:function(e,t){return this._componentFactory.createComponent(e,t)}},{key:"renderToStatic",value:function(e){this._stylesBuffer.disableInjection();var t=e(),n=this._stylesBuffer.flushToString(!0);return this._stylesBuffer.enableInjection(),{css:{content:n},html:t}}},{key:"getStylesBuffer",value:function(){return this._stylesBuffer}},{key:"getOptions",value:function(){return this._options}}]),e}();t.default=c}).call(t,n(2))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(){h&&p&&(h=!1,p.length?d=p.concat(d):_=-1,d.length&&a())}function a(){if(!h){var e=r(o);h=!0;for(var t=d.length;t;){for(p=d,d=[];++_<t;)p&&p[_].run();_=-1,t=d.length}p=null,h=!1,function(e){if(u===clearTimeout)return clearTimeout(e);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var c,u,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{u="function"==typeof clearTimeout?clearTimeout:i}catch(e){u=i}}();var p,d=[],h=!1,_=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new s(e,t)),1!==d.length||h||r(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(4),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._adonis=t,this._injectionEnabled=!0,this._bufferedSelectors={},this._buffer=[],this._styleNode=this._findStyleNode(),this._sheet=this._findSheet()}return r(e,[{key:"_findSheet",value:function(){if(this._styleNode){if(this._styleNode.sheet)return this._styleNode.sheet;for(var e=document.styleSheets,t=0;t<e.length;t++){var n=e[t];if(n.ownerNode===this._styleNode)return n}}}},{key:"_findStyleNode",value:function(){var e=this._adonis.getOptions().styleNode;return e||("undefined"==typeof document?null:((e=document.createElement("style")).setAttribute("data-adonis",!0),document.head.appendChild(e),e))}},{key:"bufferCSS",value:function(e){this._buffer.push(e)}},{key:"bufferRulesets",value:function(e){var t=this;e.forEach(function(e){var n=i(e,2),r=n[0];n[1],t._bufferedSelectors[r]=!0}),Array.prototype.push.apply(this._buffer,e.map(function(e){return i(e,2)[1]}))}},{key:"isSelectorBuffered",value:function(e){return this._bufferedSelectors[e]}},{key:"disableInjection",value:function(){this._injectionEnabled=!1}},{key:"enableInjection",value:function(){this._injectionEnabled=!0}},{key:"flushToString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._adonis.getOptions().minified,n=this._buffer.join(t?"":"\n\n");return this._buffer=[],e&&(this._bufferedSelectors={}),n}},{key:"_injectFast",value:function(){var e=this;this._buffer.forEach(function(t){e._sheet.insertRule(t,e._sheet.cssRules.length)})}},{key:"_injectDebug",value:function(){var e=this.flushToString();if(e){var t=this._adonis.getOptions().minified,n=this._styleNode.innerHTML.length>0;this._styleNode.appendChild(document.createTextNode((t||!n?"":"\n\n")+e))}}},{key:"_flushToStyleTag",value:function(){var e=this._adonis.getOptions().injectionMode;if("fast"===e&&this._sheet.insertRule)this._injectFast();else{if("debug"!==e)throw new Error("Unknown CSS injection mode: `"+e+"`");this._injectDebug()}this._buffer=[]}},{key:"flushToStyleTag",value:function(){var e=this;if(this._injectionEnabled){var t=this._adonis.getOptions().batchInjection;!this._nextTick&&t?this._nextTick=(0,o.requestAnimationFrame)(function(){e._nextTick=null,e._flushToStyleTag()}):t||this._flushToStyleTag()}}}]),e}();t.default=a},function(e,t){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=(t.defaults=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r={};for(var o in e)r[o]=e[o];for(var a=0;a<n.length;a++){var s=n[a];for(var l in s)void 0===r[l]&&(r[l]=s[l])}return r},t.hashObject=function(e){for(var t=JSON.stringify(e),n=t.length,i=n,r=0,o=void 0;n>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+((1540483477*(o>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>16)&65535)<<16)),n-=4,++r;switch(n){case 3:i^=(255&t.charCodeAt(r+2))<<16;case 2:i^=(255&t.charCodeAt(r+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(r)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),((i^=i>>>15)>>>0).toString(36)},t.flatten=function e(t){return t.reduce(function(t,n){return t.concat(Array.isArray(n)?e(n):n)},[])},t.toStaticStyles=function e(t){var i={};for(var r in t){var o=t[r];"object"===(void 0===o?"undefined":n(o))?i[r]=e(o):"function"!=typeof o&&(i[r]=o)}return i},t.deepMerge=function e(t,i){var r={};for(var o in t)r[o]=t[o];for(var a in i)"object"===n(i[a])&&t[a]?r[a]=e(t[a],i[a]):r[a]=i[a];return r});t.deepMergeAll=function(e){return e.reduce(function(e,t){return i(e,t)},{})},t.resolveStylesObject=function e(t,i){var r={};for(var o in t){var a=t[o];if("object"===(void 0===a?"undefined":n(a)))r[o]=e(a,i);else if("function"==typeof a){if(!i)throw new Error("Trying to resolve a dynamic property without a `theme` given.");r[o]=a(i)}else r[o]=a}return r},t.findAllCombinations=function(e){return function e(t,n){var i=t[0];if(void 0===i)return n;for(var r=0,o=n.length;r<o;++r)n.push(n[r].concat(i));return e(t.slice(1),n)}(e,[[]]).slice(1)},t.requestAnimationFrame=function(){for(var t=0,n=void 0===e?window:e,i=n.requestAnimationFrame,r=["ms","moz","webkit","o"],o=0;o<r.length&&!i;++o)i=n[r[o]+"RequestAnimationFrame"];return!i&&void 0!==n&&n.setImmediate&&(i=n.setImmediate),i&&(i=i.bind(n)),i||(i=function(e){var n=(new Date).getTime(),i=Math.max(0,16-(n-t)),r=setTimeout(function(){e(n+i)},i);return t=n+i,r}),i}()}).call(t,function(){return this}())},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(6),s=i(a),l=n(4),c=i(n(7)),u=i(n(16)),f=i(n(17)),p=i(n(26)),d=function(){function e(t,n){r(this,e),this._adonis=t,this._options=n}return o(e,[{key:"_getName",value:function(e){return"string"==typeof e?e:e.name?e.name:"adonis"}},{key:"_getTargetStyles",value:function(e,t){var n=[e.adonisBaseStyles,e.adonisStyles];return e.adonisTarget&&n.unshift(this._getTargetStyles(e.adonisTarget)),e.RootElement&&n.unshift(this._getTargetStyles(e.RootElement)),(0,l.flatten)(n).filter(function(e){return e})}},{key:"createComponent",value:function(e,t){var n=this._adonis,i=t.name;i||(i=this._getName(e));var d="string"==typeof e,h=e.prototype instanceof c.default,_=!h&&e.prototype instanceof a.Component,m=t.styles,g=t.variations,y=t.baseStyles;g=g||{};var v=new u.default(n,{styles:m,variations:g,name:i}),b=n.getOptions(),k=b.injection,w=b.theme,S=b.hashedStyles;if("pre"===k&&!S){var C;C=this._getTargetStyles(e,i).concat([y,v]).filter(function(e){return e}),new p.default(n,C,w).bufferRulesets(),n.getStylesBuffer().flushToStyleTag()}var E=function(a){function u(){var e;r(this,u);for(var t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=u.__proto__||Object.getPrototypeOf(u)).call.apply(e,[this].concat(i)));return a._updateStylesManager(),a._adonis=n,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(u,c.default),o(u,[{key:"_updateStylesManager",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this._allStyles=[y,v].concat(e.styles||[]).filter(function(e){return e});var t=this._getActiveVariationsFromProps(e);this._stylesManager=new f.default(n,this._allStyles,t,this.context.theme)}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=e.styles!==this.props.styles,i=!1;(0,l.flatten)(this._allStyles.map(function(e){return e.getVariations()})).forEach(function(n){e[n]!==t.props[n]&&(i=!0)}),(n||i)&&this._updateStylesManager(e)}},{key:"_cloneProps",value:function(){var e=this,t={};return Object.keys(this.props).forEach(function(n){t[n]=e.props[n]}),t}},{key:"_getActiveVariationsFromProps",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t={};return this._allStyles.forEach(function(e){return e.getVariations().forEach(function(e){return t[e]=!0})}),Object.keys(t).filter(function(t){return!0===e[t]}).sort()}},{key:"_buildClassName",value:function(){var e=this.props.className,t=[];t.push(e);var n=this._stylesManager.getClassName();return t.push(n),{className:t.filter(function(e){return e}).join(" ")}}},{key:"_shouldInjectCSS",value:function(){return!(!k||S)&&(d||_&&!h)}},{key:"render",value:function(){var n=this._cloneProps(),i=this._buildClassName().className,r=this._adonis.getStylesBuffer();if(this._shouldInjectCSS()&&(this._stylesManager.bufferRulesets(),!0!==k||S||r.flushToStyleTag()),d){var o=t.variations;o&&Object.keys(o).forEach(function(e){delete n[e]}),this.props._activeParentVariations&&this.props._activeParentVariations.forEach(function(e){delete n[e]}),y&&y.getVariations().forEach(function(e){delete n[e]})}d?n.className=i:(n.styles=(0,l.flatten)([v].concat(this.props.styles||[])),n._activeParentVariations=Object.keys(g||{}).concat(this.props._activeParentVariations||[]));var a=this.props,c=a.children,u=a.innerRef;return u&&(_||d?n.ref=u:h&&(n.innerRef=u)),d&&(delete n.styles,delete n.innerRef,delete n._activeParentVariations),s.default.createElement(e,n,c)}}],[{key:"name",get:function(){return i}}]),u}();return E.contextTypes=c.default.contextTypes,E.adonisTarget=e,E.adonisStyles=v,E.adonisBaseStyles=y,E}}]),e}();t.default=d},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=function(e){return e&&e.__esModule?e:{default:e}}(n(8)),o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),t}();t.default=o,o.contextTypes={theme:r.default.object}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=n(9)(function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},!0)}else e.exports=n(15)()}).call(t,n(2))},function(e,t,n){(function(t){"use strict";var i=n(10),r=n(11),o=n(12),a=n(13),s=n(14);e.exports=function(e,n){function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function c(e){this.message=e,this.stack=""}function u(e){function i(i,u,f,p,d,h,_){if(p=p||y,h=h||f,_!==a)if(n)r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var m=p+":"+f;!s[m]&&l<3&&(o(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",h,p),s[m]=!0,l++)}return null==u[f]?i?new c(null===u[f]?"The "+d+" `"+h+"` is marked as required in `"+p+"`, but its value is `null`.":"The "+d+" `"+h+"` is marked as required in `"+p+"`, but its value is `undefined`."):null:e(u,f,p,d,h)}if("production"!==t.env.NODE_ENV)var s={},l=0;var u=i.bind(null,!1);return u.isRequired=i.bind(null,!0),u}function f(e){return u(function(t,n,i,r,o,a){var s=t[n];return d(s)!==e?new c("Invalid "+r+" `"+o+"` of type `"+h(s)+"` supplied to `"+i+"`, expected `"+e+"`."):null})}function p(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(p);if(null===t||e(t))return!0;var n=function(e){var t=e&&(m&&e[m]||e[g]);if("function"==typeof t)return t}(t);if(!n)return!1;var i,r=n.call(t);if(n!==t.entries){for(;!(i=r.next()).done;)if(!p(i.value))return!1}else for(;!(i=r.next()).done;){var o=i.value;if(o&&!p(o[1]))return!1}return!0;default:return!1}}function d(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function h(e){if(void 0===e||null===e)return""+e;var t=d(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=h(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}var m="function"==typeof Symbol&&Symbol.iterator,g="@@iterator",y="<<anonymous>>",v={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:u(i.thatReturnsNull),arrayOf:function(e){return u(function(t,n,i,r,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+i+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new c("Invalid "+r+" `"+o+"` of type `"+d(s)+"` supplied to `"+i+"`, expected an array.")}for(var l=0;l<s.length;l++){var u=e(s,l,i,r,o+"["+l+"]",a);if(u instanceof Error)return u}return null})},element:function(){return u(function(t,n,i,r,o){var a=t[n];if(!e(a)){return new c("Invalid "+r+" `"+o+"` of type `"+d(a)+"` supplied to `"+i+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(e){return u(function(t,n,i,r,o){if(!(t[n]instanceof e)){var a=e.name||y;return new c("Invalid "+r+" `"+o+"` of type `"+function(e){return e.constructor&&e.constructor.name?e.constructor.name:y}(t[n])+"` supplied to `"+i+"`, expected instance of `"+a+"`.")}return null})},node:function(){return u(function(e,t,n,i,r){return p(e[t])?null:new c("Invalid "+i+" `"+r+"` supplied to `"+n+"`, expected a ReactNode.")})}(),objectOf:function(e){return u(function(t,n,i,r,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[n],l=d(s);if("object"!==l)return new c("Invalid "+r+" `"+o+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var u in s)if(s.hasOwnProperty(u)){var f=e(s,u,i,r,o+"."+u,a);if(f instanceof Error)return f}return null})},oneOf:function(e){return Array.isArray(e)?u(function(t,n,i,r,o){for(var a=t[n],s=0;s<e.length;s++)if(l(a,e[s]))return null;return new c("Invalid "+r+" `"+o+"` of value `"+a+"` supplied to `"+i+"`, expected one of "+JSON.stringify(e)+".")}):("production"!==t.env.NODE_ENV&&o(!1,"Invalid argument supplied to oneOf, expected an instance of array."),i.thatReturnsNull)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==t.env.NODE_ENV&&o(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),i.thatReturnsNull;for(var n=0;n<e.length;n++){var r=e[n];if("function"!=typeof r)return o(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",_(r),n),i.thatReturnsNull}return u(function(t,n,i,r,o){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,i,r,o,a))return null}return new c("Invalid "+r+" `"+o+"` supplied to `"+i+"`.")})},shape:function(e){return u(function(t,n,i,r,o){var s=t[n],l=d(s);if("object"!==l)return new c("Invalid "+r+" `"+o+"` of type `"+l+"` supplied to `"+i+"`, expected `object`.");for(var u in e){var f=e[u];if(f){var p=f(s,u,i,r,o+"."+u,a);if(p)return p}}return null})}};return c.prototype=Error.prototype,v.checkPropTypes=s,v.PropTypes=v,v}}).call(t,n(2))},function(e,t){"use strict";function n(e){return function(){return e}}var i=function(){};i.thatReturns=n,i.thatReturnsFalse=n(!1),i.thatReturnsTrue=n(!0),i.thatReturnsNull=n(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,n){(function(t){"use strict";var n=function(e){};"production"!==t.env.NODE_ENV&&(n=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=function(e,t,i,r,o,a,s,l){if(n(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[i,r,o,a,s,l],f=0;(c=new Error(t.replace(/%s/g,function(){return u[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}}).call(t,n(2))},function(e,t,n){(function(t){"use strict";var i=n(10);"production"!==t.env.NODE_ENV&&(i=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,i=Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];(function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=0,o="Warning: "+e.replace(/%s/g,function(){return n[r++]});"undefined"!=typeof console&&console.error(o);try{throw new Error(o)}catch(e){}}).apply(void 0,[t].concat(i))}}),e.exports=i}).call(t,n(2))},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){(function(t){"use strict";if("production"!==t.env.NODE_ENV)var i=n(11),r=n(12),o=n(13),a={};e.exports=function(e,n,s,l,c){if("production"!==t.env.NODE_ENV)for(var u in e)if(e.hasOwnProperty(u)){var f;try{i("function"==typeof e[u],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",l||"React class",s,u),f=e[u](n,u,l,s,null,o)}catch(e){f=e}if(r(!f||f instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",s,u,typeof f),f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=c?c():"";r(!1,"Failed %s type: %s%s",s,f.message,null!=p?p:"")}}}}).call(t,n(2))},function(e,t,n){"use strict";var i=n(10),r=n(11),o=n(13);e.exports=function(){function e(e,t,n,i,a,s){s!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=i,n.PropTypes=n,n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(4),o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._adonis=t,this._options=(0,r.defaults)(n,{variations:[],styles:{},name:"Unnamed"});var i=this._adonis.getOptions().hashedStyles;if(i&&"string"!=typeof this._options.styles)throw new Error("Passing style objects with `hashedStyles` set to true is invalid.");this._hash=i?this._options.styles:(0,r.hashObject)(this._options.styles),this._variationHashes=this._hashVariations()}return i(e,[{key:"_hashVariations",value:function(){var e={},t=this._adonis.getOptions().hashedStyles,n=this._options.variations;for(var i in n){var o=n[i];e[i]=t?o:(0,r.hashObject)(o)}return e}},{key:"getIdentifierForVariations",value:function(e){var t=this,n=this._options.name,i=this._adonis.getOptions(),r=i.hashSeparator,o=i.variationSeparator,a=""+n+r+this._hash;return e.sort().forEach(function(e){var n=t._variationHashes[e];n&&(a+=""+o+e+r+n)}),a}},{key:"getStyles",value:function(){return this._options.styles}},{key:"getVariationStyles",value:function(e){var t=this._options.variations;return e?e.map(function(e){return t[e]}).filter(function(e){return e}):t}},{key:"getVariations",value:function(){return Object.keys(this._options.variations||{})}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(4),o=function(e){return e&&e.__esModule?e:{default:e}}(n(18)),a=function(){function e(t,n,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._adonis=t,this._styles=n,this._theme=r,this._activeVariations=i,this._className=this._generateClassName(this._activeVariations),this._baseSelector="."+this._className,this._rulesets=this._generateRulesets()}return i(e,[{key:"generateCSS",value:function(){return this._rulesets.map(function(e){return e.toCSS()}).filter(function(e){return e})}},{key:"bufferRulesets",value:function(){var e=this._adonis.getStylesBuffer(),t=this._rulesets.filter(function(t){return!e.isSelectorBuffered(t.getSelector())&&t.hasDeclarations()}).map(function(e){return[e.getSelector(),e.toCSS()]});e.bufferRulesets(t)}},{key:"_getCombinedStyles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,r.flatten)(this._styles.map(function(t){return[t.getStyles(),t.getVariationStyles(e)]}));return(0,r.deepMergeAll)(t)}},{key:"_generateClassName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this._adonis.getOptions(),n=t.nameSeparator;return t.classNamePrefix+this._styles.map(function(t){return t.getIdentifierForVariations(e)}).join(n)}},{key:"_generateRulesets",value:function(){var e=new o.default(this._adonis,this._baseSelector,this._getCombinedStyles(this._activeVariations),{theme:this._theme});return(0,r.flatten)([e,e.getSubRulesets()])}},{key:"getClassName",value:function(){return this._className}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(4),a=i(n(19)),s=i(n(21)),l=function(){function e(t,n,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._options=r,this._adonis=t,this._selector=n,this._styles=i,this._resolvedStyles=(0,o.resolveStylesObject)(this._styles,this._options.theme);var a=this._adonis.getOptions().hashedStyles;this._hash=a?this._styles:(0,o.hashObject)(this._styles);var s=this._parseStyles(),l=s.subRulesets,c=s.declarations;this._subRulesets=l,this._declarations=c}return r(e,[{key:"_getSubRuleset",value:function(t,n){for(var i=this,r=this._adonis.getOptions().minified,a=null,l=function(t,r){var s=(0,o.deepMerge)(i._options,{parentSelector:r});a=new e(i._adonis,t,n,s)},c=0;c<s.default.length;c++)if((0,s.default[c])(t,this._selector,l,r),a)return a}},{key:"_parseStyles",value:function(){var e=[],t=[];for(var n in this._resolvedStyles){var i=this._resolvedStyles[n],r=this._getSubRuleset(n,i);r?e.push(r,r.getSubRulesets()):t.push(new a.default(this._adonis,n,i))}return{subRulesets:e,declarations:t}}},{key:"toCSS",value:function(){var e=this._options.parentSelector,t=this._adonis.getOptions(),n=t.minified,i=t.cssSelectorPrefix;if(0===this._declarations.length)return null;var r=e&&e.match(/^@/),o="",a="";e?(i&&!r&&(o+=i),o+=e+(n?"{":" {\n"),a="  "):o+=i;var s="";return i&&r&&(s+=i),s+=this._selector,o+=a+s+(n?"{":" {\n"),this._declarations.forEach(function(e){o+=a+e.toCSS()+(n?"":"\n")}),o+=a+"}",e&&(o+=n?"}":"\n}"),o}},{key:"getSubRulesets",value:function(){return this._subRulesets}},{key:"hasDeclarations",value:function(){return 0!==this._declarations.length}},{key:"getSelector",value:function(){return this._selector}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(n(20)),a=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._adonis=t,this.key=n,this.value=i,this.cssKey=this.key.replace(/([A-Z])/g,function(e){return"-"+e[0].toLowerCase()})}return r(e,[{key:"_getAutoPrefixedKeyPairs",value:function(){var e=this,t=o.default[this.key],n=[];return t&&t.forEach(function(t){n.push(["-"+t+"-"+e.cssKey,e.value])}),n}},{key:"toCSS",value:function(){var e=this._adonis.getOptions(),t=e.minified,n=e.autoPrefix,r=[[this.cssKey,this.value]];return n&&(r=r.concat(this._getAutoPrefixedKeyPairs())),r.map(function(e){var n=i(e,2),r=n[0],o=n[1];return(t?"":"  ")+r+":"+(t?"":" ")+o+";"}).join(t?"":"\n")}}]),e}();t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="webkit",i="moz",r="ms";t.default={appearance:[n,i],userSelect:[n,i,r],textEmphasisPosition:[n],textEmphasis:[n],textEmphasisStyle:[n],textEmphasisColor:[n],boxDecorationBreak:[n],clipPath:[n],maskImage:[n],maskMode:[n],maskRepeat:[n],maskPosition:[n],maskClip:[n],maskOrigin:[n],maskSize:[n],maskComposite:[n],mask:[n],maskBorderSource:[n],maskBorderMode:[n],maskBorderSlice:[n],maskBorderWidth:[n],maskBorderOutset:[n],maskBorderRepeat:[n],maskBorder:[n],maskType:[n],textDecorationStyle:[n],textDecorationSkip:[n],textDecorationLine:[n],textDecorationColor:[n],filter:[n],fontFeatureSettings:[n],breakAfter:[n,i,r],breakBefore:[n,i,r],breakInside:[n,i,r],columnCount:[n,i],columnFill:[n,i],columnGap:[n,i],columnRule:[n,i],columnRuleColor:[n,i],columnRuleStyle:[n,i],columnRuleWidth:[n,i],columns:[n,i],columnSpan:[n,i],columnWidth:[n,i],flex:[n],flexBasis:[n],flexDirection:[n],flexGrow:[n],flexFlow:[n],flexShrink:[n],flexWrap:[n],alignContent:[n],alignItems:[n],alignSelf:[n],justifyContent:[n],order:[n],transform:[n],transformOrigin:[n],transformOriginX:[n],transformOriginY:[n],backfaceVisibility:[n],perspective:[n],perspectiveOrigin:[n],transformStyle:[n],transformOriginZ:[n],animation:[n],animationDelay:[n],animationDirection:[n],animationFillMode:[n],animationDuration:[n],animationIterationCount:[n],animationName:[n],animationPlayState:[n],animationTimingFunction:[n],backdropFilter:[n],fontKerning:[n],scrollSnapType:[n,r],scrollSnapPointsX:[n,r],scrollSnapPointsY:[n,r],scrollSnapDestination:[n,r],scrollSnapCoordinate:[n,r],shapeImageThreshold:[n],shapeImageMargin:[n],shapeImageOutside:[n],hyphens:[n,i,r],flowInto:[n,r],flowFrom:[n,r],regionFragment:[n,r],textAlignLast:[i],tabSize:[i],wrapFlow:[r],wrapThrough:[r],wrapMargin:[r],gridTemplateColumns:[r],gridTemplateRows:[r],gridTemplateAreas:[r],gridTemplate:[r],gridAutoColumns:[r],gridAutoRows:[r],gridAutoFlow:[r],grid:[r],gridRowStart:[r],gridColumnStart:[r],gridRowEnd:[r],gridRow:[r],gridColumn:[r],gridColumnEnd:[r],gridColumnGap:[r],gridRowGap:[r],gridArea:[r],gridGap:[r],textSizeAdjust:[n,r],transitionDelay:[n],transitionDuration:[n],transitionProperty:[n],transitionTimingFunction:[n]}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(22)),o=i(n(23)),a=i(n(24)),s=i(n(25));t.default=[r.default,o.default,a.default,s.default]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){if(">"!==(e=e.trim())[0])return null;e=e.slice(1).trim();var r=t;return i||(r+=" "),r+=">",i||(r+=" "),n(r+=e)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){if("&"!==(e=e.trim())[0])return null;var r=!e.match(/^&\s+/);return n((e=e.replace(/^&/,"")).split(",").map(function(e){return e.trim()}).map(function(e,n){return t+(0===n&&r?"":" ")+e}).join(", "))}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){return":"!==(e=e.trim())[0]?null:n(t+e)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){return"@"!==(e=e.trim())[0]?null:n(t,e)}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(4),a=i(n(18)),s=i(n(17)),l=function(e){function t(e,n,i){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,[],i))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,s.default),r(t,[{key:"_generateVariationRulesets",value:function(){var e=this,t=(0,o.flatten)(this._styles.map(function(e){return e.getVariations()}));return(0,o.findAllCombinations)(t).map(function(t){var n="."+e._generateClassName(t),i=new a.default(e._adonis,n,e._getCombinedStyles(t),{theme:e._theme});return[i,i.getSubRulesets()]})}},{key:"_generateRulesets",value:function(){var e=new a.default(this._adonis,this._baseSelector,this._getCombinedStyles(),{theme:this._theme}),t=[e,e.getSubRulesets()];return t.push(this._generateVariationRulesets()),(0,o.flatten)(t)}}]),t}();t.default=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(16)),r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default),t}();t.default=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=i(n(6)),a=i(n(8));t.default=function(e){var t=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,o.default.Component),r(n,[{key:"_cloneProps",value:function(){var e=this,t={};return Object.keys(this.props).forEach(function(n){t[n]=e.props[n]}),t}},{key:"render",value:function(){var t=this._cloneProps(),n=t.innerRef;return n&&(t.ref=n),delete t.innerRef,o.default.createElement(e,t)}}]),n}();return t.contextTypes={theme:a.default.object},t}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(6),a=i(o),s=i(n(8)),l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.Component),r(t,[{key:"getChildContext",value:function(){var e={};for(var t in this.context)e[t]=this.context;return e.theme=this.props.theme,e}},{key:"render",value:function(){return this.props.children?a.default.Children.only(this.props.children):null}}]),t}();t.default=l,l.childContextTypes={theme:s.default.object.isRequired},l.contextTypes={theme:s.default.object}}])}(n(39))}()},function(e,t,n){n(97),n(40),n(50),n(177),n(185),n(186),e.exports=n(10).Promise},function(e,t,n){var i=n(67),r=n(64);e.exports=function(e){return function(t,n){var o,a,s=String(r(t)),l=i(n),c=s.length;return l<0||l>=c?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){"use strict";var i=n(65),r=n(34),o=n(49),a={};n(22)(a,n(13)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(a,{next:r(1,n)}),o(e,t+" Iterator")}},function(e,t,n){"use strict";var i=n(175),r=n(176),o=n(31),a=n(19);e.exports=n(98)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var i,r,o,a,s=n(37),l=n(12),c=n(27),u=n(71),f=n(11),p=n(17),d=n(46),h=n(178),_=n(179),m=n(102),g=n(73).set,y=n(181)(),v=n(74),b=n(103),k=n(182),w=n(104),S=l.TypeError,C=l.process,E=C&&C.versions,x=E&&E.v8||"",T=l.Promise,O="process"==u(C),R=function(){},D=r=v.f,I=!!function(){try{var e=T.resolve(1),t=(e.constructor={})[n(13)("species")]=function(e){e(R,R)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(R)instanceof t&&0!==x.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},A=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var i=e._v,r=1==e._s,o=0;n.length>o;)!function(t){var n,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&j(e),e._h=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),a=!0)),n===t.promise?c(S("Promise-chain cycle")):(o=P(n))?o.call(n,l,c):l(n)):c(i)}catch(e){u&&!a&&u.exit(),c(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){g.call(l,function(){var t,n,i,r=e._v,o=F(e);if(o&&(t=b(function(){O?C.emit("unhandledRejection",r,e):(n=l.onunhandledrejection)?n({promise:e,reason:r}):(i=l.console)&&i.error&&i.error("Unhandled promise rejection",r)}),e._h=O||F(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},F=function(e){return 1!==e._h&&0===(e._a||e._c).length},j=function(e){g.call(l,function(){var t;O?C.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})})},B=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),A(t,!0))},N=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=P(e))?y(function(){var i={_w:n,_d:!1};try{t.call(e,c(N,i,1),c(B,i,1))}catch(e){B.call(i,e)}}):(n._v=e,n._s=1,A(n,!1))}catch(e){B.call({_w:n,_d:!1},e)}}};I||(T=function(e){h(this,T,"Promise","_h"),d(e),i.call(this);try{e(c(N,this,1),c(B,this,1))}catch(e){B.call(this,e)}},(i=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(183)(T.prototype,{then:function(e,t){var n=D(m(this,T));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new i;this.promise=e,this.resolve=c(N,e,1),this.reject=c(B,e,1)},v.f=D=function(e){return e===T||e===a?new o(e):r(e)}),f(f.G+f.W+f.F*!I,{Promise:T}),n(49)(T,"Promise"),n(184)("Promise"),a=n(10).Promise,f(f.S+f.F*!I,"Promise",{reject:function(e){var t=D(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!I),"Promise",{resolve:function(e){return w(s&&this===a?T:this,e)}}),f(f.S+f.F*!(I&&n(105)(function(e){T.all(e).catch(R)})),"Promise",{all:function(e){var t=this,n=D(t),i=n.resolve,r=n.reject,o=b(function(){var n=[],o=0,a=1;_(e,!1,function(e){var s=o++,l=!1;n.push(void 0),a++,t.resolve(e).then(function(e){l||(l=!0,n[s]=e,--a||i(n))},r)}),--a||i(n)});return o.e&&r(o.v),n.promise},race:function(e){var t=this,n=D(t),i=n.reject,r=b(function(){_(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(e,t){e.exports=function(e,t,n,i){if(!(e instanceof t)||void 0!==i&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(27),r=n(100),o=n(101),a=n(14),s=n(66),l=n(72),c={},u={};(t=e.exports=function(e,t,n,f,p){var d,h,_,m,g=p?function(){return e}:l(e),y=i(n,f,t?2:1),v=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(d=s(e.length);d>v;v++)if((m=t?y(a(h=e[v])[0],h[1]):y(e[v]))===c||m===u)return m}else for(_=g.call(e);!(h=_.next()).done;)if((m=r(_,y,h.value,t))===c||m===u)return m}).BREAK=c,t.RETURN=u},function(e,t){e.exports=function(e,t,n){var i=void 0===n;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(12),r=n(73).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,l="process"==n(36)(a);e.exports=function(){var e,t,n,c=function(){var i,r;for(l&&(i=a.domain)&&i.exit();e;){r=e.fn,e=e.next;try{r()}catch(i){throw e?n():t=void 0,i}}t=void 0,i&&i.enter()};if(l)n=function(){a.nextTick(c)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){r.call(i,c)};else{var f=!0,p=document.createTextNode("");new o(c).observe(p,{characterData:!0}),n=function(){p.data=f=!f}}return function(i){var r={fn:i,next:void 0};t&&(t.next=r),e||(e=r,n()),t=r}}},function(e,t,n){var i=n(12).navigator;e.exports=i&&i.userAgent||""},function(e,t,n){var i=n(22);e.exports=function(e,t,n){for(var r in t)n&&e[r]?e[r]=t[r]:i(e,r,t[r]);return e}},function(e,t,n){"use strict";var i=n(12),r=n(10),o=n(16),a=n(18),s=n(13)("species");e.exports=function(e){var t="function"==typeof r[e]?r[e]:i[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var i=n(11),r=n(10),o=n(12),a=n(102),s=n(104);i(i.P+i.R,"Promise",{finally:function(e){var t=a(this,r.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var i=n(11),r=n(74),o=n(103);i(i.S,"Promise",{try:function(e){var t=r.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(7),a=n.n(o),s=n(51),l=n(208),c=n(52),u=a.a.Utils,f=a.a.Math.Vector2,p={getInnerDimensionsForElement:function(e){var t=new f(e.offsetWidth,e.offsetHeight),n=window.getComputedStyle(e,null);return t.x-=parseInt(n.getPropertyValue("padding-left"),10),t.x-=parseInt(n.getPropertyValue("padding-right"),10),t.y-=parseInt(n.getPropertyValue("padding-top"),10),t.y-=parseInt(n.getPropertyValue("padding-bottom"),10),t},getEventPosition:function(e){var t=e.clientX,n=e.clientY;if(-1!==e.type.indexOf("touch")){if(!e.touches.length)return;t=e.touches[0].clientX,n=e.touches[0].clientY}return new f(t,n)},createTransparentPatternCanvas:function(){var e=document.createElement("canvas"),t=e.getContext("2d");return e.width=10,e.height=10,t.fillStyle="white",t.fillRect(0,0,e.width,e.height),t.fillStyle="#cccccc",t.fillRect(0,0,e.width/2,e.height/2),t.fillRect(e.width/2,e.height/2,e.width,e.height),e},supportsMSBlob:function(){return void 0!==document.createElement("canvas").msToBlob},translate:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.fetch(e,t);if(!r){s.a.info("Utils#translate","Unable to translate `"+t+"`");var o=n(220)[t];return null!=o?(s.a.warn("Utils#translate","Trying to find localized string for old key: `"+o+"`. Please update your localization to use the new key as soon as possible. Support for the old, deprecated key will be dropped with the next major version update."),this.translate(e,o,i)):null}for(var a in i)r=r.replace("${"+a+"}",i[a]);return r},fetch:function(e,t,n){for(var i=(t=(t=t.replace(/\[(\w+)]/g,".$1")).replace(/^\./,"")).split("."),r=0;r<i.length&&(e=e[i[r]]);r++);return void 0!==e&&e},isMobile:function(){var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))},select:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;n||(n=function(e){return e});var i=[];return t.forEach(function(t){e.forEach(function(e){n(e)===t&&i.push(e)})}),i},getJSONP:function(e){return new c.a(e).load()},cloneCategories:function(e,t){return e.map(function(e){return(e=u.clone(e))[t]=e[t].slice(0),e})},mergeCategories:function(e,t,n){e=this.cloneCategories(e,n);var i=null;return t.forEach(function(t){e.forEach(function(e){t.identifier===e.identifier&&(i=e)}),i?i[n]=i[n].concat(t[n]):e.push(t)}),e},wrapFiltersInCategories:function(e,t){return e.map(function(e){var n=e;return t in n||(n=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({identifier:"imgly_filters_wrapped-"+e.identifier,displayFlat:!0},t,[e])),n})},getStyleObject:function(e){var t=window.getComputedStyle(e),n={};for(var i in t){var r=t.getPropertyValue(i),o=i.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});""!==r&&(n[o]=r)}return n},styleElement:function(e,t){for(var n in t)e.style[n]=t[n]},debounce:function(e,t,n){var i;return function(){var r=this,o=arguments,a=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(r,o)},t),a&&e.apply(this,o)}},getScrollbarWidth:function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var i=n.offsetWidth;return e.parentNode.removeChild(e),t-i},findIntegerFraction:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=Number.MAX_VALUE,i=0,r=0,o=1,a=1,s=0;s<t;s++){var l=o/a-e;if(l<0)o++;else{if(!(l>0))return new f(o,a);a++}var c=Math.abs(o/a-e);c<n&&(n=c,i=o,r=a)}return new f(i,r)},toFixed:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e.toFixed(t);return parseFloat(n)},capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},flipObject:function(e){var t={};for(var n in e)t[e[n]]=n;return t},Browser:l.a};t.a=p},function(e,t,n){n(40),n(189),e.exports=n(10).Array.from},function(e,t,n){"use strict";var i=n(27),r=n(11),o=n(38),a=n(100),s=n(101),l=n(66),c=n(190),u=n(72);r(r.S+r.F*!n(105)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,r,f,p=o(e),d="function"==typeof this?this:Array,h=arguments.length,_=h>1?arguments[1]:void 0,m=void 0!==_,g=0,y=u(p);if(m&&(_=i(_,h>2?arguments[2]:void 0,2)),void 0==y||d==Array&&s(y))for(n=new d(t=l(p.length));t>g;g++)c(n,g,m?_(p[g],g):p[g]);else for(f=y.call(p),n=new d;!(r=f.next()).done;g++)c(n,g,m?a(f,_,[r.value,g],!0):r.value);return n.length=g,n}})},function(e,t,n){"use strict";var i=n(16),r=n(34);e.exports=function(e,t,n){t in e?i.f(e,t,r(0,n)):e[t]=n}},function(e,t,n){var i=n(10),r=i.JSON||(i.JSON={stringify:JSON.stringify});e.exports=function(e){return r.stringify.apply(r,arguments)}},function(e,t,n){"use strict";(function(e){function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return s()(e)}var r=n(9),o=n.n(r),a=n(20),s=n.n(a),l=n(41),c=n.n(l),u=n(42),f=n.n(u),p=n(0),d=n.n(p),h=n(8),_=n.n(h),m=n(43),g=n.n(m),y=n(1),v=n.n(y),b=n(206),k=n(207),w=o.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},S="function"==typeof f.a&&"symbol"==typeof c.a?function(e){return typeof e}:function(e){return e&&"function"==typeof f.a&&e.constructor===f.a&&e!==f.a.prototype?"symbol":typeof e},C=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),d()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),E=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}return C(t,null,[{key:"isArray",value:function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{key:"mapRange",value:function(e,t,n){return(e-t.getMin())*n.getLength()/t.getLength()+n.getMin()}},{key:"isPlainObject",value:function(e){if("object"!==(void 0===e?"undefined":S(e))||!e)return!1;if("function"==typeof v.a){var t=v()(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}},{key:"isMobile",value:function(){if("undefined"==typeof navigator)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}},{key:"isBrowser",value:function(){return"undefined"!=typeof window}},{key:"isNode",value:function(){return"undefined"==typeof window&&void 0!==e}},{key:"values",value:function(e){var t=[];for(var n in e)t.push(e[n]);return t}},{key:"generateUUID",value:function(){var e=(new Date).getTime();return void 0!==window.performance&&"function"==typeof window.performance.now&&(e+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}},{key:"isDOMElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":S(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":S(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"isTouchEvent",value:function(e){return-1!==e.type.indexOf("touch")}},{key:"resizeVectorToFit",value:function(e,t){var n=Math.min(t.x/e.x,t.y/e.y);return e.clone().multiply(n)}},{key:"resizeVectorToFill",value:function(e,t){var n=e.x/e.y;return n>t.x/t.y?t.clone().set(t.y*n,t.y):t.clone().set(t.x,t.x/n)}},{key:"isExtendable",value:function(e){return void 0!==e&&null!==e&&("object"===(void 0===e?"undefined":S(e))||"function"==typeof e)}},{key:"defaults",value:function(e){var t={};for(var n in e)t[n]=e[n];for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];for(var a=0;a<r.length;a++){var s=r[a];for(var l in s)void 0===t[l]&&(t[l]=s[l])}return t}},{key:"deepMerge",value:function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(function e(n,r){if(void 0===r)return e(null,n);if(Array.isArray(r))return[].concat(i(r));if(!t.isPlainObject(r))return r;if(!t.isPlainObject(n))return w({},r);var o=w({},n);return g()(r).forEach(function(t){var i=r[t];void 0!==i&&(o[t]=e(n[t],i))}),o},e)}},{key:"deepDefaults",value:function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=[].concat(r).reverse();return t.deepMerge.apply(t,i(a).concat([e]))}},{key:"deepClone",value:function(e){var n={};for(var i in e)t.isExtendable(e[i])?n[i]=t.deepClone(e[i]):n[i]=e[i];return n}},{key:"getDeepProperty",value:function(e,t){return"string"==typeof t?e[t]:Array.isArray(t)?t.reduce(function(e,t){return e?"function"==typeof t?function(e,t){var n=void 0;try{n=t(e)}catch(e){if(!(e instanceof TypeError))throw e}return n}(e,t):e[t]:null},e):void 0}},{key:"extend",value:function(e){var t={};for(var n in e)t[n]=e[n];for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];for(var a=0;a<r.length;a++){var s=r[a];for(var l in s)t[l]=s[l]}return t}},{key:"clone",value:function(e){return this.extend({},e)}},{key:"createBlobURIFromDataURI",value:function(t){var n="undefined"==typeof window?e:window;if(!(n.Blob&&n.URL&&ArrayBuffer&&Uint8Array))return t;for(var i=b.a.decode(t.split(",")[1]),r=t.split(",")[0].split(":")[1].split(";")[0],o=new ArrayBuffer(i.length),a=new Uint8Array(o),s=0;s<i.length;s++)a[s]=i[s];var l=new n.Blob([o],{type:r});return n.URL.createObjectURL(l)}},{key:"getUUID",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},{key:"createCanvas",value:function(){return document.createElement("canvas")}},{key:"convertHtmlImageToRGBACanvas",value:function(e,n){var i=n||t.createCanvas();i.width=e.width,i.height=e.height;var r=i.getContext("2d");return r.clearRect(0,0,i.width,i.height),r.drawImage(e,0,0,e.width,e.height),i}},{key:"isPowerOfTwo",value:function(e){return 0==(e.x&e.x-1)&&0==(e.y&e.y-1)}},{key:"nextLowestPOT",value:function(e){for(var t=1;t<32;t<<=1)e|=e>>t;return e-(e>>1)}},{key:"nextHighestPOT",value:function(e){e--;for(var t=1;t<32;t<<=1)e|=e>>t;return e+1}},{key:"moveArrayItem",value:function(e,t,n){if(n>=e.length)for(var i=n-e.length;1+i--;)e.push(void 0);e.splice(n,0,e.splice(t,1)[0])}},{key:"ensureCanvasDimensions",value:function(e,t){e.width===t.x&&e.height===t.y||(e.width=t.x,e.height=t.y)}},{key:"byteArrayToString",value:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")}},{key:"clamp",value:function(e,t,n){return Math.max(t,Math.min(e,n))}},{key:"wildCardMatch",value:function(e,t){return new RegExp("^"+t.split("*").join(".*")+"$").test(e)}},{key:"flipObject",value:function(e){var t={};for(var n in e)t[e[n]]=n;return t}},{key:"cloneOptions",value:function(e){var t={};for(var n in e){var i=e[n];Array.isArray(i)?i=i.slice():i.clone&&(i=i.clone()),t[n]=i}return t}},{key:"ISODateString",value:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z"}},{key:"getCrossOriginValue",value:function(e){return e?"none"!==e?e:void 0:"anonymous"}},{key:"shallowEqual",value:function(e,t){if(e===t)return!0;if("object"!==(void 0===e?"undefined":S(e))||null===e||"object"!==(void 0===t?"undefined":S(t))||null===t)return!1;var n=g()(e),i=g()(t);if(n.length!==i.length)return!1;for(var r=hasOwnProperty.bind(t),o=0;o<n.length;o++)if(!r(n[o])||e[n[o]]!==t[n[o]])return!1;return!0}},{key:"enableIf",value:function(e,t){return e?t:void 0}},{key:"invariant",value:function(e,t){if(!e)throw new Error(t)}},{key:"executePromises",value:function(e){var t=e.length,n=0,i=[],r=[];return new _.a(function(o,a){var s=function(){++n>=t&&(r.length<=0?o(i):a(r))},l=function(e){i.push(e),s()},c=function(e){r.push(e),s()};e.forEach(function(e){e.then(l).catch(c)})})}}]),t}();E.Array=k.a,t.a=E}).call(t,n(30))},function(e,t,n){n(194),e.exports=n(10).Object.assign},function(e,t,n){var i=n(11);i(i.S+i.F,"Object",{assign:n(195)})},function(e,t,n){"use strict";var i=n(29),r=n(75),o=n(35),a=n(38),s=n(91),l=Object.assign;e.exports=!l||n(28)(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=i})?function(e,t){for(var n=a(e),l=arguments.length,c=1,u=r.f,f=o.f;l>c;)for(var p,d=s(arguments[c++]),h=u?i(d).concat(u(d)):i(d),_=h.length,m=0;_>m;)f.call(d,p=h[m++])&&(n[p]=d[p]);return n}:l},function(e,t,n){n(40),n(50),e.exports=n(76).f("iterator")},function(e,t,n){n(198),n(97),n(202),n(203),e.exports=n(10).Symbol},function(e,t,n){"use strict";var i=n(12),r=n(23),o=n(18),a=n(11),s=n(99),l=n(108).KEY,c=n(28),u=n(69),f=n(49),p=n(47),d=n(13),h=n(76),_=n(77),m=n(199),g=n(200),y=n(14),v=n(17),b=n(19),k=n(62),w=n(34),S=n(65),C=n(201),E=n(63),x=n(16),T=n(29),O=E.f,R=x.f,D=C.f,I=i.Symbol,P=i.JSON,A=P&&P.stringify,M=d("_hidden"),F=d("toPrimitive"),j={}.propertyIsEnumerable,B=u("symbol-registry"),N=u("symbols"),L=u("op-symbols"),z=Object.prototype,U="function"==typeof I,V=i.QObject,W=!V||!V.prototype||!V.prototype.findChild,H=o&&c(function(){return 7!=S(R({},"a",{get:function(){return R(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=O(z,t);i&&delete z[t],R(e,t,n),i&&e!==z&&R(z,t,i)}:R,q=function(e){var t=N[e]=S(I.prototype);return t._k=e,t},G=U&&"symbol"==typeof I.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof I},K=function(e,t,n){return e===z&&K(L,t,n),y(e),t=k(t,!0),y(n),r(N,t)?(n.enumerable?(r(e,M)&&e[M][t]&&(e[M][t]=!1),n=S(n,{enumerable:w(0,!1)})):(r(e,M)||R(e,M,w(1,{})),e[M][t]=!0),H(e,t,n)):R(e,t,n)},Z=function(e,t){y(e);for(var n,i=m(t=b(t)),r=0,o=i.length;o>r;)K(e,n=i[r++],t[n]);return e},Y=function(e){var t=j.call(this,e=k(e,!0));return!(this===z&&r(N,e)&&!r(L,e))&&(!(t||!r(this,e)||!r(N,e)||r(this,M)&&this[M][e])||t)},Q=function(e,t){if(e=b(e),t=k(t,!0),e!==z||!r(N,t)||r(L,t)){var n=O(e,t);return!n||!r(N,t)||r(e,M)&&e[M][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=D(b(e)),i=[],o=0;n.length>o;)r(N,t=n[o++])||t==M||t==l||i.push(t);return i},X=function(e){for(var t,n=e===z,i=D(n?L:b(e)),o=[],a=0;i.length>a;)!r(N,t=i[a++])||n&&!r(z,t)||o.push(N[t]);return o};U||(s((I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===z&&t.call(L,n),r(this,M)&&r(this[M],e)&&(this[M][e]=!1),H(this,e,w(1,n))};return o&&W&&H(z,e,{configurable:!0,set:t}),q(e)}).prototype,"toString",function(){return this._k}),E.f=Q,x.f=K,n(109).f=C.f=J,n(35).f=Y,n(75).f=X,o&&!n(37)&&s(z,"propertyIsEnumerable",Y,!0),h.f=function(e){return q(d(e))}),a(a.G+a.W+a.F*!U,{Symbol:I});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;$.length>ee;)d($[ee++]);for(var te=T(d.store),ne=0;te.length>ne;)_(te[ne++]);a(a.S+a.F*!U,"Symbol",{for:function(e){return r(B,e+="")?B[e]:B[e]=I(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in B)if(B[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!U,"Object",{create:function(e,t){return void 0===t?S(e):Z(S(e),t)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:X}),P&&a(a.S+a.F*(!U||c(function(){var e=I();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=[e],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=t=i[1],(v(t)||void 0!==e)&&!G(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),i[1]=t,A.apply(P,i)}}),I.prototype[F]||n(22)(I.prototype,F,I.prototype.valueOf),f(I,"Symbol"),f(Math,"Math",!0),f(i.JSON,"JSON",!0)},function(e,t,n){var i=n(29),r=n(75),o=n(35);e.exports=function(e){var t=i(e),n=r.f;if(n)for(var a,s=n(e),l=o.f,c=0;s.length>c;)l.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var i=n(36);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,n){var i=n(19),r=n(109).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return r(e)}catch(e){return a.slice()}}(e):r(i(e))}},function(e,t,n){n(77)("asyncIterator")},function(e,t,n){n(77)("observable")},function(e,t,n){n(205),e.exports=n(10).Object.keys},function(e,t,n){var i=n(38),r=n(29);n(48)("keys",function(){return function(e){return r(i(e))}})},function(e,t,n){"use strict";var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r={encode:function(e){var t="",n=void 0,r=void 0,o=void 0,a=void 0,s=void 0,l=void 0,c=void 0,u=0;do{a=(n=e[u++])>>2,s=(3&n)<<4|(r=e[u++])>>4,l=(15&r)<<2|(o=e[u++])>>6,c=63&o,isNaN(r)?l=c=64:isNaN(o)&&(c=64),t=t+i.charAt(a)+i.charAt(s)+i.charAt(l)+i.charAt(c),n=r=o="",a=s=l=c=""}while(u<e.length);return t},decode:function(e){var t=void 0,n=void 0,r=void 0,o=void 0,a=void 0,s=void 0,l=0,c=[];if(/[^A-Za-z0-9+\/=]/g.exec(e))throw new Error("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding.");e=e.replace(/[^A-Za-z0-9+\/=]/g,"");do{t=i.indexOf(e.charAt(l++))<<2|(o=i.indexOf(e.charAt(l++)))>>4,n=(15&o)<<4|(a=i.indexOf(e.charAt(l++)))>>2,r=(3&a)<<6|(s=i.indexOf(e.charAt(l++))),c.push(t),64!==a&&c.push(n),64!==s&&c.push(r),t=n=r="",o=a=s=""}while(l<e.length);return c}};t.a=r},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return o(e,null,[{key:"head",value:function(e){return e[0]}},{key:"tail",value:function(e){return e.slice(1)}},{key:"last",value:function(e){return e[e.length-1]}},{key:"init",value:function(e){return e.slice(0,e.length-1)}},{key:"remove",value:function(e,t){return e.filter(function(e,n,i){return!t(e,n,i)})}},{key:"findIndex",value:function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}},{key:"find",value:function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}},{key:"flatten",value:function(t){return t.reduce(function(t,n){return t.concat(Array.isArray(n)?e.flatten(n):n)},[])}},{key:"range",value:function(e,t){var n=[];if(t>e)for(var i=e;i<t;i++)n.push(i);return n}},{key:"repeat",value:function(e,t){for(var n=[],i=0;i<t;i++)n[i]=e;return n}},{key:"zip",value:function(e,t){for(var n=Math.min(e.length,t.length),i=[],r=0;r<n;r++)i[r]=[e[r],t[r]];return i}}]),e}();t.a=a},function(e,t,n){"use strict";t.a={getIEVersion:function(){var e=navigator,t=e.userAgent,n=e.appVersion;return-1!==n.indexOf("MSIE")?n.match(/MSIE\s+?([0-9]+)/i)[1]:-1!==t.indexOf("Trident")&&t.match(/rv:([0-9]+)/i)[1]},isIE10:function(){var e=this.getIEVersion();return!1!==e&&10===e},isIE11:function(){var e=this.getIEVersion();return!1!==e&&11===e},isIElte:function(e){var t=this.getIEVersion();return!1!==t&&t<=e}}},function(e,t,n){"use strict";(function(e){var i=n(41),r=n.n(i),o=n(42),a=n.n(o),s=n(8),l=n.n(s),c=n(0),u=n.n(c),f=n(210),p=n.n(f),d="function"==typeof a.a&&"symbol"==typeof r.a?function(e){return typeof e}:function(e){return e&&"function"==typeof a.a&&e.constructor===a.a&&e!==a.a.prototype?"symbol":typeof e},h=void 0===e?window:e,_=void 0!==l.a?l.a:function(){function e(e,t){f.add(e,t),c||(c=_(f.drain))}function t(e){var t,n=void 0===e?"undefined":d(e);return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function n(){for(var e=0;e<this.chain.length;e++)i(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function i(e,n,i){var r,o;try{!1===n?i.reject(e.msg):(r=!0===n?e.msg:n.call(void 0,e.msg))===i.promise?i.reject(TypeError("Promise-chain cycle")):(o=t(r))?o.call(r,i.resolve,i.reject):i.resolve(r)}catch(e){i.reject(e)}}function r(t){var i=this;i.triggered||(i.triggered=!0,i.def&&(i=i.def),i.msg=t,i.state=2,i.chain.length>0&&e(n,i))}function o(e,t,n,i){for(var r=0;r<t.length;r++)!function(r){e.resolve(t[r]).then(function(e){n(r,e)},i)}(r)}function a(e){this.def=e,this.triggered=!1}function s(i){if("function"!=typeof i)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var o=new function(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}(this);this.then=function(t,i){var r={success:"function"!=typeof t||t,failure:"function"==typeof i&&i};return r.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t}),o.chain.push(r),0!==o.state&&e(n,o),r.promise},this.catch=function(e){return this.then(void 0,e)};try{i.call(void 0,function(i){(function i(o){var s,l=this;if(!l.triggered){l.triggered=!0,l.def&&(l=l.def);try{(s=t(o))?e(function(){var e=new a(l);try{s.call(o,function(){i.apply(e,arguments)},function(){r.apply(e,arguments)})}catch(t){r.call(e,t)}}):(l.msg=o,l.state=1,l.chain.length>0&&e(n,l))}catch(i){r.call(new a(l),i)}}}).call(o,i)},function(e){r.call(o,e)})}catch(i){r.call(o,i)}}var l,c,f,h=Object.prototype.toString,_=void 0!==p.a?function(e){return p()(e)}:setTimeout;try{Object.defineProperty({},"x",{}),l=function(e,t,n,i){return u()(e,t,{value:n,writable:!0,configurable:!1!==i})}}catch(c){l=function(e,t,n){return e[t]=n,e}}f=function(){var e,t,n;return{add:function(i,r){n=new function(e,t){this.fn=e,this.self=t,this.next=void 0}(i,r),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=c=void 0;n;)n.fn.call(n.self),n=n.next}}}();var m=l({},"constructor",s,!1);return s.prototype=m,l(m,"__NPO__",0,!1),l(s,"resolve",function(e){return e&&"object"==(void 0===e?"undefined":d(e))&&1===e.__NPO__?e:new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)})}),l(s,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),l(s,"all",function(e){var t=this;return"[object Array]"!=h.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");var r=e.length,a=Array(r),s=0;o(t,e,function(e,t){a[e]=t,++s===r&&n(a)},i)})}),l(s,"race",function(e){var t=this;return"[object Array]"!=h.call(e)?t.reject(TypeError("Not an array")):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");o(t,e,function(e,t){n(t)},i)})}),s}();h.Promise=h.Promise||_,t.a=_}).call(t,n(30))},function(e,t,n){e.exports={default:n(211),__esModule:!0}},function(e,t,n){n(212),e.exports=n(10).setImmediate},function(e,t,n){var i=n(11),r=n(73);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(e,t,n){"use strict";function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function r(e,t,n){if(e&&a.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}var o=n(214),a=n(216);t.parse=r,t.resolve=function(e,t){return r(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?r(e,!1,!0).resolveObject(t):t},t.format=function(e){return a.isString(e)&&(e=r(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),p=["%","/","?",";","#"].concat(f),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(217);i.prototype.parse=function(e,t,n){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),r=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(r);l[0]=l[0].replace(/\\/g,"/");var u=e=l.join(r);if(u=u.trim(),!n&&1===e.split("#").length){var b=c.exec(u);if(b)return this.path=u,this.href=u,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var k=s.exec(u);if(k){var w=(k=k[0]).toLowerCase();this.protocol=w,u=u.substr(k.length)}if(n||k||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===u.substr(0,2);!S||k&&g[k]||(u=u.substr(2),this.slashes=!0)}if(!g[k]&&(S||k&&!y[k])){for(var C,E,x=-1,T=0;T<d.length;T++)-1!==(O=u.indexOf(d[T]))&&(-1===x||O<x)&&(x=O);for(-1!==(E=-1===x?u.lastIndexOf("@"):u.lastIndexOf("@",x))&&(C=u.slice(0,E),u=u.slice(E+1),this.auth=decodeURIComponent(C)),x=-1,T=0;T<p.length;T++){var O;-1!==(O=u.indexOf(p[T]))&&(-1===x||O<x)&&(x=O)}-1===x&&(x=u.length),this.host=u.slice(0,x),u=u.slice(x),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var D=this.hostname.split(/\./),I=(T=0,D.length);T<I;T++){var P=D[T];if(P&&!P.match(h)){for(var A="",M=0,F=P.length;M<F;M++)P.charCodeAt(M)>127?A+="x":A+=P[M];if(!A.match(h)){var j=D.slice(0,T),B=D.slice(T+1),N=P.match(_);N&&(j.push(N[1]),B.unshift(N[2])),B.length&&(u="/"+B.join(".")+u),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var L=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+L,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!m[w])for(T=0,I=f.length;T<I;T++){var U=f[T];if(-1!==u.indexOf(U)){var V=encodeURIComponent(U);V===U&&(V=escape(U)),u=u.split(U).join(V)}}var W=u.indexOf("#");-1!==W&&(this.hash=u.substr(W),u=u.slice(0,W));var H=u.indexOf("?");if(-1!==H?(this.search=u.substr(H),this.query=u.substr(H+1),t&&(this.query=v.parse(this.query)),u=u.slice(0,H)):t&&(this.search="",this.query={}),u&&(this.pathname=u),y[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var q=this.search||"";this.path=L+q}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",i=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(o=v.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==r?(r="//"+(r||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):r||(r=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),t+r+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+i},i.prototype.resolve=function(e){return this.resolveObject(r(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(a.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),o=0;o<r.length;o++){var s=r[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(n[u]=e[u])}return y[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!y[e.protocol]){for(var f=Object.keys(e),p=0;p<f.length;p++){var d=f[p];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var _=n.pathname||"",m=n.search||"";n.path=_+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var v=n.pathname&&"/"===n.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),k=b||v||n.host&&e.pathname,w=k,S=n.pathname&&n.pathname.split("/")||[],C=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!y[n.protocol]);if(C&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),k=k&&(""===h[0]||""===S[0])),b)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=h;else if(h.length)S||(S=[]),S.pop(),S=S.concat(h),n.search=e.search,n.query=e.query;else if(!a.isNullOrUndefined(e.search))return C&&(n.hostname=n.host=S.shift(),(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift())),n.search=e.search,n.query=e.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=S.slice(-1)[0],x=(n.host||e.host||S.length>1)&&("."===E||".."===E)||""===E,T=0,O=S.length;O>=0;O--)"."===(E=S[O])?S.splice(O,1):".."===E?(S.splice(O,1),T++):T&&(S.splice(O,1),T--);if(!k&&!w)for(;T--;T)S.unshift("..");!k||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),x&&"/"!==S.join("/").substr(-1)&&S.push("");var R,D=""===S[0]||S[0]&&"/"===S[0].charAt(0);return C&&(n.hostname=n.host=D?"":S.length?S.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift())),(k=k||n.host&&S.length)&&!D&&S.unshift(""),S.length?n.pathname=S.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){(function(e,i){var r;!function(i){function o(e){throw new RangeError(O[e])}function a(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function s(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+a((e=e.replace(T,".")).split("."),t).join(".")}function l(e){for(var t,n,i=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(n=e.charCodeAt(r++)))?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--):i.push(t);return i}function c(e){return a(e,function(e){var t="";return e>65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function u(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:g}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function p(e,t,n){var i=0;for(e=n?D(e/k):e>>1,e+=D(e/t);e>R*v>>1;i+=g)e=D(e/R);return D(i+(R+1)*e/(e+b))}function d(e){var t,n,i,r,a,s,l,f,d,h,_=[],b=e.length,k=0,E=S,x=w;for((n=e.lastIndexOf(C))<0&&(n=0),i=0;i<n;++i)e.charCodeAt(i)>=128&&o("not-basic"),_.push(e.charCodeAt(i));for(r=n>0?n+1:0;r<b;){for(a=k,s=1,l=g;r>=b&&o("invalid-input"),((f=u(e.charCodeAt(r++)))>=g||f>D((m-k)/s))&&o("overflow"),k+=f*s,!(f<(d=l<=x?y:l>=x+v?v:l-x));l+=g)s>D(m/(h=g-d))&&o("overflow"),s*=h;x=p(k-a,t=_.length+1,0==a),D(k/t)>m-E&&o("overflow"),E+=D(k/t),k%=t,_.splice(k++,0,E)}return c(_)}function h(e){var t,n,i,r,a,s,c,u,d,h,_,b,k,E,x,T=[];for(b=(e=l(e)).length,t=S,n=0,a=w,s=0;s<b;++s)(_=e[s])<128&&T.push(I(_));for(i=r=T.length,r&&T.push(C);i<b;){for(c=m,s=0;s<b;++s)(_=e[s])>=t&&_<c&&(c=_);for(c-t>D((m-n)/(k=i+1))&&o("overflow"),n+=(c-t)*k,t=c,s=0;s<b;++s)if((_=e[s])<t&&++n>m&&o("overflow"),_==t){for(u=n,d=g;!(u<(h=d<=a?y:d>=a+v?v:d-a));d+=g)x=u-h,E=g-h,T.push(I(f(h+x%E,0))),u=D(x/E);T.push(I(f(u,0))),a=p(n,k,i==r),n=0,++i}++n,++t}return T.join("")}"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var _,m=2147483647,g=36,y=1,v=26,b=38,k=700,w=72,S=128,C="-",E=/^xn--/,x=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=g-y,D=Math.floor,I=String.fromCharCode;_={version:"1.4.1",ucs2:{decode:l,encode:c},decode:d,encode:h,toASCII:function(e){return s(e,function(e){return x.test(e)?"xn--"+h(e):e})},toUnicode:function(e){return s(e,function(e){return E.test(e)?d(e.slice(4).toLowerCase()):e})}},void 0===(r=function(){return _}.call(t,n,t,e))||(e.exports=r)}()}).call(t,n(215)(e),n(30))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(218),t.encode=t.stringify=n(219)},function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var u=0;u<c;++u){var f,p,d,h,_=e[u].replace(s,"%20"),m=_.indexOf(n);m>=0?(f=_.substr(0,m),p=_.substr(m+1)):(f=_,p=""),d=decodeURIComponent(f),h=decodeURIComponent(p),i(a,d)?r(a[d])?a[d].push(h):a[d]=[a[d],h]:a[d]=h}return a};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i<e.length;i++)n.push(t(e[i],i));return n}var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var s=encodeURIComponent(r(a))+n;return o(e[a])?i(e[a],function(e){return s+encodeURIComponent(r(e))}).join(t):s+encodeURIComponent(r(e[a]))}).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t){e.exports={"pesdk.adjustments.button.reset":"editor.controls.adjustments.reset","pesdk.adjustments.text.brightness":"editor.controls.adjustments.items.brightness","pesdk.adjustments.text.clarity":"editor.controls.adjustments.items.clarity","pesdk.adjustments.text.contrast":"editor.controls.adjustments.items.contrast","pesdk.adjustments.text.exposure":"editor.controls.adjustments.items.exposure","pesdk.adjustments.text.gamma":"editor.controls.adjustments.items.gamma","pesdk.adjustments.text.highlights":"editor.controls.adjustments.items.highlights","pesdk.adjustments.text.saturation":"editor.controls.adjustments.items.saturation","pesdk.adjustments.text.shadows":"editor.controls.adjustments.items.shadows","pesdk.adjustments.title.basics":"editor.controls.adjustments.sections.basics","pesdk.adjustments.title.name":"editor.controls.adjustments.title","pesdk.adjustments.title.refinements":"editor.controls.adjustments.sections.refinements","pesdk.brush.title.hardness":"editor.controls.brush.hardness","pesdk.brush.title.name":"editor.controls.brush.title","pesdk.brush.title.settings":"editor.controls.brush.settings","pesdk.brush.title.width":"editor.controls.brush.width","pesdk.common.button.cancel":"editor.cancel","pesdk.common.text.loading":"loading.loading","pesdk.common.title.error":"errors.title","pesdk.editor.button.discardChangesWarningDiscard":"warnings.discardChanges.buttons.discard","pesdk.editor.button.discardChangesWarningKeep":"warnings.discardChanges.buttons.keep","pesdk.editor.button.export":"editor.export","pesdk.editor.button.newImageChangesLostWarningNo":"warnings.newImage_changesLost.buttons.no","pesdk.editor.button.newImageChangesLostWarningYes":"warnings.newImage_changesLost.buttons.yes","pesdk.editor.text.discardChangesWarning":"warnings.discardChanges.text","pesdk.editor.text.fontLoadingError":"errors.fontLoadingError.text","pesdk.editor.text.imageLoadingError":"errors.imageLoadingError.text","pesdk.editor.text.imageResizedWarning_maxDimensions":"warnings.imageResized_maxDimensions.text","pesdk.editor.text.imageResizedWarning_maxMegaPixels":"warnings.imageResized_maxMegaPixels.text","pesdk.editor.text.invalidFileTypeError":"errors.invalidFileType.text","pesdk.editor.text.loadingFonts":"loading.fonts","pesdk.editor.text.newImageChangesLostWarning":"warnings.newImage_changesLost.text","pesdk.editor.text.renderingError":"errors.renderingError.text","pesdk.editor.text.resizing":"loading.resizing","pesdk.editor.text.webcamUnavailableError":"errors.webcamUnavailable.text","pesdk.editor.title.discardChangesWarning":"warnings.discardChanges.title","pesdk.editor.title.fontLoadingError":"errors.fontLoadingError.title","pesdk.editor.title.imageResizedWarning_maxDimensions":"warnings.imageResized_maxDimensions.title","pesdk.editor.title.imageResizedWarning_maxMegaPixels":"warnings.imageResized_maxMegaPixels.title","pesdk.editor.title.newImageChangesLostWarning":"warnings.newImage_changesLost.title","pesdk.filter.asset.identity":"editor.controls.filter.filters.identity","pesdk.filter.asset.imgly_lut_ad1920":"editor.controls.filter.filters.imgly_lut_ad1920","pesdk.filter.asset.imgly_lut_ancient":"editor.controls.filter.filters.imgly_lut_ancient","pesdk.filter.asset.imgly_lut_bleached":"editor.controls.filter.filters.imgly_lut_bleached","pesdk.filter.asset.imgly_lut_bleachedblue":"editor.controls.filter.filters.imgly_lut_bleachedblue","pesdk.filter.asset.imgly_lut_blues":"editor.controls.filter.filters.imgly_lut_blues","pesdk.filter.asset.imgly_lut_blueshadows":"editor.controls.filter.filters.imgly_lut_blueshadows","pesdk.filter.asset.imgly_lut_breeze":"editor.controls.filter.filters.imgly_lut_breeze","pesdk.filter.asset.imgly_lut_bw":"editor.controls.filter.filters.imgly_lut_bw","pesdk.filter.asset.imgly_lut_celsius":"editor.controls.filter.filters.imgly_lut_celsius","pesdk.filter.asset.imgly_lut_chest":"editor.controls.filter.filters.imgly_lut_chest","pesdk.filter.asset.imgly_lut_classic":"editor.controls.filter.filters.imgly_lut_classic","pesdk.filter.asset.imgly_lut_colorful":"editor.controls.filter.filters.imgly_lut_colorful","pesdk.filter.asset.imgly_lut_cool":"editor.controls.filter.filters.imgly_lut_cool","pesdk.filter.asset.imgly_lut_cottoncandy":"editor.controls.filter.filters.imgly_lut_cottoncandy","pesdk.filter.asset.imgly_lut_creamy":"editor.controls.filter.filters.imgly_lut_creamy","pesdk.filter.asset.imgly_lut_eighties":"editor.controls.filter.filters.imgly_lut_eighties","pesdk.filter.asset.imgly_lut_elder":"editor.controls.filter.filters.imgly_lut_elder","pesdk.filter.asset.imgly_lut_evening":"editor.controls.filter.filters.imgly_lut_evening","pesdk.filter.asset.imgly_lut_fall":"editor.controls.filter.filters.imgly_lut_fall","pesdk.filter.asset.imgly_lut_fixie":"editor.controls.filter.filters.imgly_lut_fixie","pesdk.filter.asset.imgly_lut_food":"editor.controls.filter.filters.imgly_lut_food","pesdk.filter.asset.imgly_lut_fridge":"editor.controls.filter.filters.imgly_lut_fridge","pesdk.filter.asset.imgly_lut_front":"editor.controls.filter.filters.imgly_lut_front","pesdk.filter.asset.imgly_lut_glam":"editor.controls.filter.filters.imgly_lut_glam","pesdk.filter.asset.imgly_lut_gobblin":"editor.controls.filter.filters.imgly_lut_gobblin","pesdk.filter.asset.imgly_lut_highcarb":"editor.controls.filter.filters.imgly_lut_highcarb","pesdk.filter.asset.imgly_lut_highcontrast":"editor.controls.filter.filters.imgly_lut_highcontrast","pesdk.filter.asset.imgly_lut_k1":"editor.controls.filter.filters.imgly_lut_k1","pesdk.filter.asset.imgly_lut_k2":"editor.controls.filter.filters.imgly_lut_k2","pesdk.filter.asset.imgly_lut_k6":"editor.controls.filter.filters.imgly_lut_k6","pesdk.filter.asset.imgly_lut_kdynamic":"editor.controls.filter.filters.imgly_lut_kdynamic","pesdk.filter.asset.imgly_lut_keen":"editor.controls.filter.filters.imgly_lut_keen","pesdk.filter.asset.imgly_lut_lenin":"editor.controls.filter.filters.imgly_lut_lenin","pesdk.filter.asset.imgly_lut_litho":"editor.controls.filter.filters.imgly_lut_litho","pesdk.filter.asset.imgly_lut_lomo100":"editor.controls.filter.filters.imgly_lut_lomo100","pesdk.filter.asset.imgly_lut_lucid":"editor.controls.filter.filters.imgly_lut_lucid","pesdk.filter.asset.imgly_lut_mellow":"editor.controls.filter.filters.imgly_lut_mellow","pesdk.filter.asset.imgly_lut_neat":"editor.controls.filter.filters.imgly_lut_neat","pesdk.filter.asset.imgly_lut_nogreen":"editor.controls.filter.filters.imgly_lut_nogreen","pesdk.filter.asset.imgly_lut_orchid":"editor.controls.filter.filters.imgly_lut_orchid","pesdk.filter.asset.imgly_lut_pale":"editor.controls.filter.filters.imgly_lut_pale","pesdk.filter.asset.imgly_lut_pitched":"editor.controls.filter.filters.imgly_lut_pitched","pesdk.filter.asset.imgly_lut_plate":"editor.controls.filter.filters.imgly_lut_plate","pesdk.filter.asset.imgly_lut_pola669":"editor.controls.filter.filters.imgly_lut_pola669","pesdk.filter.asset.imgly_lut_polasx":"editor.controls.filter.filters.imgly_lut_polasx","pesdk.filter.asset.imgly_lut_pro400":"editor.controls.filter.filters.imgly_lut_pro400","pesdk.filter.asset.imgly_lut_quozi":"editor.controls.filter.filters.imgly_lut_quozi","pesdk.filter.asset.imgly_lut_sepiahigh":"editor.controls.filter.filters.imgly_lut_sepiahigh","pesdk.filter.asset.imgly_lut_settled":"editor.controls.filter.filters.imgly_lut_settled","pesdk.filter.asset.imgly_lut_seventies":"editor.controls.filter.filters.imgly_lut_seventies","pesdk.filter.asset.imgly_lut_sin":"editor.controls.filter.filters.imgly_lut_sin","pesdk.filter.asset.imgly_lut_soft":"editor.controls.filter.filters.imgly_lut_soft","pesdk.filter.asset.imgly_lut_steel":"editor.controls.filter.filters.imgly_lut_steel","pesdk.filter.asset.imgly_lut_summer":"editor.controls.filter.filters.imgly_lut_summer","pesdk.filter.asset.imgly_lut_sunset":"editor.controls.filter.filters.imgly_lut_sunset","pesdk.filter.asset.imgly_lut_tender":"editor.controls.filter.filters.imgly_lut_tender","pesdk.filter.asset.imgly_lut_texas":"editor.controls.filter.filters.imgly_lut_texas","pesdk.filter.asset.imgly_lut_twilight":"editor.controls.filter.filters.imgly_lut_twilight","pesdk.filter.asset.imgly_lut_winter":"editor.controls.filter.filters.imgly_lut_winter","pesdk.filter.asset.imgly_lut_x400":"editor.controls.filter.filters.imgly_lut_x400","pesdk.filter.title.name":"editor.controls.filter.title","pesdk.focus.button.gaussian":"editor.controls.focus.items.gaussian","pesdk.focus.button.linear":"editor.controls.focus.items.linear","pesdk.focus.button.mirrored":"editor.controls.focus.items.mirrored","pesdk.focus.button.none":"editor.controls.focus.items.none","pesdk.focus.button.radial":"editor.controls.focus.items.radial","pesdk.focus.title.name":"editor.controls.focus.title","pesdk.frame.asset.imgly_frame_art_decor":"editor.controls.frame.frames.imgly_frame_art_decor","pesdk.frame.asset.imgly_frame_black_passepartout":"editor.controls.frame.frames.imgly_frame_black_passepartout","pesdk.frame.asset.imgly_frame_dia":"editor.controls.frame.frames.imgly_frame_dia","pesdk.frame.asset.imgly_frame_lowpoly_shadow":"editor.controls.frame.frames.imgly_frame_lowpoly_shadow","pesdk.frame.asset.imgly_frame_wood_passepartout":"editor.controls.frame.frames.imgly_frame_wood_passepartout","pesdk.frame.button.fill":"editor.controls.frame.fill","pesdk.frame.button.replace":"editor.controls.frame.replace","pesdk.frame.title.name":"editor.controls.frame.title","pesdk.frame.title.opacity":"editor.controls.frame.opacity","pesdk.frame.title.width":"editor.controls.frame.width","pesdk.library.button.fileDropZone":"editor.controls.library.fileDropZone","pesdk.library.button.fileDropZoneHovered":"editor.controls.library.fileDropZoneHovered","pesdk.library.placeholder.search":"editor.controls.library.search","pesdk.library.text.noResults":"editor.controls.library.noResults","pesdk.library.title.name":"editor.controls.library.title","pesdk.overlay.asset.imgly_overlay_bokeh":"editor.controls.overlay.overlays.imgly_overlay_bokeh","pesdk.overlay.asset.imgly_overlay_chop":"editor.controls.overlay.overlays.imgly_overlay_chop","pesdk.overlay.asset.imgly_overlay_clouds":"editor.controls.overlay.overlays.imgly_overlay_clouds","pesdk.overlay.asset.imgly_overlay_golden":"editor.controls.overlay.overlays.imgly_overlay_golden","pesdk.overlay.asset.imgly_overlay_grain":"editor.controls.overlay.overlays.imgly_overlay_grain","pesdk.overlay.asset.imgly_overlay_hearts":"editor.controls.overlay.overlays.imgly_overlay_hearts","pesdk.overlay.asset.imgly_overlay_lightleak1":"editor.controls.overlay.overlays.imgly_overlay_lightleak1","pesdk.overlay.asset.imgly_overlay_lightleak2":"editor.controls.overlay.overlays.imgly_overlay_lightleak2","pesdk.overlay.asset.imgly_overlay_metal":"editor.controls.overlay.overlays.imgly_overlay_metal","pesdk.overlay.asset.imgly_overlay_mosaic":"editor.controls.overlay.overlays.imgly_overlay_mosaic","pesdk.overlay.asset.imgly_overlay_painting":"editor.controls.overlay.overlays.imgly_overlay_painting","pesdk.overlay.asset.imgly_overlay_paper":"editor.controls.overlay.overlays.imgly_overlay_paper","pesdk.overlay.asset.imgly_overlay_rain":"editor.controls.overlay.overlays.imgly_overlay_rain","pesdk.overlay.asset.imgly_overlay_vintage":"editor.controls.overlay.overlays.imgly_overlay_vintage","pesdk.overlay.asset.imgly_overlay_wall1":"editor.controls.overlay.overlays.imgly_overlay_wall1","pesdk.overlay.asset.imgly_overlay_wall2":"editor.controls.overlay.overlays.imgly_overlay_wall2","pesdk.overlay.asset.imgly_overlay_wood":"editor.controls.overlay.overlays.imgly_overlay_wood","pesdk.overlay.button.none":"editor.controls.overlay.overlays.none","pesdk.overlay.title.blending":"editor.controls.overlay.blendModes.blending","pesdk.overlay.title.colorBurn":"editor.controls.overlay.blendModes.colorBurn","pesdk.overlay.title.darken":"editor.controls.overlay.blendModes.darken","pesdk.overlay.title.hardLight":"editor.controls.overlay.blendModes.hardLight","pesdk.overlay.title.lighten":"editor.controls.overlay.blendModes.lighten","pesdk.overlay.title.multiply":"editor.controls.overlay.blendModes.multiply","pesdk.overlay.title.name":"editor.controls.overlay.title","pesdk.overlay.title.none":"editor.controls.overlay.blendModes.none","pesdk.overlay.title.normal":"editor.controls.overlay.blendModes.normal","pesdk.overlay.title.overlay":"editor.controls.overlay.blendModes.overlay","pesdk.overlay.title.screen":"editor.controls.overlay.blendModes.screen","pesdk.overlay.title.softLight":"editor.controls.overlay.blendModes.softLight","pesdk.sticker.asset.imgly_sticker_emoticons":"editor.controls.sticker.stickerCategories.imgly_sticker_emoticons","pesdk.sticker.asset.imgly_sticker_emoticons_alien":"editor.controls.sticker.stickers.imgly_sticker_emoticons_alien","pesdk.sticker.asset.imgly_sticker_emoticons_angel":"editor.controls.sticker.stickers.imgly_sticker_emoticons_angel","pesdk.sticker.asset.imgly_sticker_emoticons_angry":"editor.controls.sticker.stickers.imgly_sticker_emoticons_angry","pesdk.sticker.asset.imgly_sticker_emoticons_anxious":"editor.controls.sticker.stickers.imgly_sticker_emoticons_anxious","pesdk.sticker.asset.imgly_sticker_emoticons_asleep":"editor.controls.sticker.stickers.imgly_sticker_emoticons_asleep","pesdk.sticker.asset.imgly_sticker_emoticons_attention":"editor.controls.sticker.stickers.imgly_sticker_emoticons_attention","pesdk.sticker.asset.imgly_sticker_emoticons_baby_chicken":"editor.controls.sticker.stickers.imgly_sticker_emoticons_baby_chicken","pesdk.sticker.asset.imgly_sticker_emoticons_batman":"editor.controls.sticker.stickers.imgly_sticker_emoticons_batman","pesdk.sticker.asset.imgly_sticker_emoticons_beer":"editor.controls.sticker.stickers.imgly_sticker_emoticons_beer","pesdk.sticker.asset.imgly_sticker_emoticons_black":"editor.controls.sticker.stickers.imgly_sticker_emoticons_black","pesdk.sticker.asset.imgly_sticker_emoticons_blue":"editor.controls.sticker.stickers.imgly_sticker_emoticons_blue","pesdk.sticker.asset.imgly_sticker_emoticons_blush":"editor.controls.sticker.stickers.imgly_sticker_emoticons_blush","pesdk.sticker.asset.imgly_sticker_emoticons_boxer":"editor.controls.sticker.stickers.imgly_sticker_emoticons_boxer","pesdk.sticker.asset.imgly_sticker_emoticons_business":"editor.controls.sticker.stickers.imgly_sticker_emoticons_business","pesdk.sticker.asset.imgly_sticker_emoticons_chicken":"editor.controls.sticker.stickers.imgly_sticker_emoticons_chicken","pesdk.sticker.asset.imgly_sticker_emoticons_cool":"editor.controls.sticker.stickers.imgly_sticker_emoticons_cool","pesdk.sticker.asset.imgly_sticker_emoticons_cry":"editor.controls.sticker.stickers.imgly_sticker_emoticons_cry","pesdk.sticker.asset.imgly_sticker_emoticons_deceased":"editor.controls.sticker.stickers.imgly_sticker_emoticons_deceased","pesdk.sticker.asset.imgly_sticker_emoticons_devil":"editor.controls.sticker.stickers.imgly_sticker_emoticons_devil","pesdk.sticker.asset.imgly_sticker_emoticons_duckface":"editor.controls.sticker.stickers.imgly_sticker_emoticons_duckface","pesdk.sticker.asset.imgly_sticker_emoticons_furious":"editor.controls.sticker.stickers.imgly_sticker_emoticons_furious","pesdk.sticker.asset.imgly_sticker_emoticons_grin":"editor.controls.sticker.stickers.imgly_sticker_emoticons_grin","pesdk.sticker.asset.imgly_sticker_emoticons_guitar":"editor.controls.sticker.stickers.imgly_sticker_emoticons_guitar","pesdk.sticker.asset.imgly_sticker_emoticons_harry_potter":"editor.controls.sticker.stickers.imgly_sticker_emoticons_harry_potter","pesdk.sticker.asset.imgly_sticker_emoticons_hippie":"editor.controls.sticker.stickers.imgly_sticker_emoticons_hippie","pesdk.sticker.asset.imgly_sticker_emoticons_hitman":"editor.controls.sticker.stickers.imgly_sticker_emoticons_hitman","pesdk.sticker.asset.imgly_sticker_emoticons_humourous":"editor.controls.sticker.stickers.imgly_sticker_emoticons_humourous","pesdk.sticker.asset.imgly_sticker_emoticons_idea":"editor.controls.sticker.stickers.imgly_sticker_emoticons_idea","pesdk.sticker.asset.imgly_sticker_emoticons_impatient":"editor.controls.sticker.stickers.imgly_sticker_emoticons_impatient","pesdk.sticker.asset.imgly_sticker_emoticons_kiss":"editor.controls.sticker.stickers.imgly_sticker_emoticons_kiss","pesdk.sticker.asset.imgly_sticker_emoticons_kisses":"editor.controls.sticker.stickers.imgly_sticker_emoticons_kisses","pesdk.sticker.asset.imgly_sticker_emoticons_laugh":"editor.controls.sticker.stickers.imgly_sticker_emoticons_laugh","pesdk.sticker.asset.imgly_sticker_emoticons_loud_cry":"editor.controls.sticker.stickers.imgly_sticker_emoticons_loud_cry","pesdk.sticker.asset.imgly_sticker_emoticons_loving":"editor.controls.sticker.stickers.imgly_sticker_emoticons_loving","pesdk.sticker.asset.imgly_sticker_emoticons_masked":"editor.controls.sticker.stickers.imgly_sticker_emoticons_masked","pesdk.sticker.asset.imgly_sticker_emoticons_music":"editor.controls.sticker.stickers.imgly_sticker_emoticons_music","pesdk.sticker.asset.imgly_sticker_emoticons_nerd":"editor.controls.sticker.stickers.imgly_sticker_emoticons_nerd","pesdk.sticker.asset.imgly_sticker_emoticons_ninja":"editor.controls.sticker.stickers.imgly_sticker_emoticons_ninja","pesdk.sticker.asset.imgly_sticker_emoticons_not_speaking_to_you":"editor.controls.sticker.stickers.imgly_sticker_emoticons_not_speaking_to_you","pesdk.sticker.asset.imgly_sticker_emoticons_pig":"editor.controls.sticker.stickers.imgly_sticker_emoticons_pig","pesdk.sticker.asset.imgly_sticker_emoticons_pumpkin":"editor.controls.sticker.stickers.imgly_sticker_emoticons_pumpkin","pesdk.sticker.asset.imgly_sticker_emoticons_question":"editor.controls.sticker.stickers.imgly_sticker_emoticons_question","pesdk.sticker.asset.imgly_sticker_emoticons_rabbit":"editor.controls.sticker.stickers.imgly_sticker_emoticons_rabbit","pesdk.sticker.asset.imgly_sticker_emoticons_sad":"editor.controls.sticker.stickers.imgly_sticker_emoticons_sad","pesdk.sticker.asset.imgly_sticker_emoticons_sick":"editor.controls.sticker.stickers.imgly_sticker_emoticons_sick","pesdk.sticker.asset.imgly_sticker_emoticons_skateboard":"editor.controls.sticker.stickers.imgly_sticker_emoticons_skateboard","pesdk.sticker.asset.imgly_sticker_emoticons_skull":"editor.controls.sticker.stickers.imgly_sticker_emoticons_skull","pesdk.sticker.asset.imgly_sticker_emoticons_sleepy":"editor.controls.sticker.stickers.imgly_sticker_emoticons_sleepy","pesdk.sticker.asset.imgly_sticker_emoticons_smile":"editor.controls.sticker.stickers.imgly_sticker_emoticons_smile","pesdk.sticker.asset.imgly_sticker_emoticons_smoking":"editor.controls.sticker.stickers.imgly_sticker_emoticons_smoking","pesdk.sticker.asset.imgly_sticker_emoticons_sobbing":"editor.controls.sticker.stickers.imgly_sticker_emoticons_sobbing","pesdk.sticker.asset.imgly_sticker_emoticons_star":"editor.controls.sticker.stickers.imgly_sticker_emoticons_star","pesdk.sticker.asset.imgly_sticker_emoticons_steaming_furious":"editor.controls.sticker.stickers.imgly_sticker_emoticons_steaming_furious","pesdk.sticker.asset.imgly_sticker_emoticons_sunbathing":"editor.controls.sticker.stickers.imgly_sticker_emoticons_sunbathing","pesdk.sticker.asset.imgly_sticker_emoticons_tired":"editor.controls.sticker.stickers.imgly_sticker_emoticons_tired","pesdk.sticker.asset.imgly_sticker_emoticons_tongue_out_wink":"editor.controls.sticker.stickers.imgly_sticker_emoticons_tongue_out_wink","pesdk.sticker.asset.imgly_sticker_emoticons_wave":"editor.controls.sticker.stickers.imgly_sticker_emoticons_wave","pesdk.sticker.asset.imgly_sticker_emoticons_wide_grin":"editor.controls.sticker.stickers.imgly_sticker_emoticons_wide_grin","pesdk.sticker.asset.imgly_sticker_emoticons_wink":"editor.controls.sticker.stickers.imgly_sticker_emoticons_wink","pesdk.sticker.asset.imgly_sticker_emoticons_wrestler":"editor.controls.sticker.stickers.imgly_sticker_emoticons_wrestler","pesdk.sticker.asset.imgly_sticker_shapes":"editor.controls.sticker.stickerCategories.imgly_sticker_shapes","pesdk.sticker.asset.imgly_sticker_shapes_arrow_02":"editor.controls.sticker.stickers.imgly_sticker_shapes_arrow_02","pesdk.sticker.asset.imgly_sticker_shapes_arrow_03":"editor.controls.sticker.stickers.imgly_sticker_shapes_arrow_03","pesdk.sticker.asset.imgly_sticker_shapes_badge_01":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_01","pesdk.sticker.asset.imgly_sticker_shapes_badge_04":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_04","pesdk.sticker.asset.imgly_sticker_shapes_badge_06":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_06","pesdk.sticker.asset.imgly_sticker_shapes_badge_08":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_08","pesdk.sticker.asset.imgly_sticker_shapes_badge_11":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_11","pesdk.sticker.asset.imgly_sticker_shapes_badge_12":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_12","pesdk.sticker.asset.imgly_sticker_shapes_badge_13":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_13","pesdk.sticker.asset.imgly_sticker_shapes_badge_15":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_15","pesdk.sticker.asset.imgly_sticker_shapes_badge_18":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_18","pesdk.sticker.asset.imgly_sticker_shapes_badge_19":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_19","pesdk.sticker.asset.imgly_sticker_shapes_badge_20":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_20","pesdk.sticker.asset.imgly_sticker_shapes_badge_28":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_28","pesdk.sticker.asset.imgly_sticker_shapes_badge_32":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_32","pesdk.sticker.asset.imgly_sticker_shapes_badge_35":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_35","pesdk.sticker.asset.imgly_sticker_shapes_badge_36":"editor.controls.sticker.stickers.imgly_sticker_shapes_badge_36","pesdk.sticker.asset.imgly_sticker_shapes_spray_01":"editor.controls.sticker.stickers.imgly_sticker_shapes_spray_01","pesdk.sticker.asset.imgly_sticker_shapes_spray_03":"editor.controls.sticker.stickers.imgly_sticker_shapes_spray_03","pesdk.sticker.asset.imgly_sticker_shapes_spray_04":"editor.controls.sticker.stickers.imgly_sticker_shapes_spray_04","pesdk.sticker.button.fill":"editor.controls.sticker.fill","pesdk.sticker.button.new":"editor.controls.sticker.new","pesdk.sticker.button.replace":"editor.controls.sticker.replace","pesdk.sticker.text.stickerLoadingError":"errors.stickerLoadingError.text","pesdk.sticker.title.name":"editor.controls.sticker.title","pesdk.sticker.title.opacity":"editor.controls.sticker.opacity","pesdk.text.button.new":"editor.controls.text.new","pesdk.text.placeholder.defaultText":"editor.controls.text.defaultText","pesdk.text.title.background":"editor.controls.text.background","pesdk.text.title.font":"editor.controls.text.font","pesdk.text.title.line":"editor.controls.text.line","pesdk.text.title.name":"editor.controls.text.title","pesdk.text.title.size":"editor.controls.text.size","pesdk.text.title.spacing":"editor.controls.text.spacing","pesdk.textdesign.title.name":"editor.controls.textdesign.title","pesdk.transform.asset.imgly_transforms_common.imgly_transform_common_16-9":"editor.controls.transform.ratios.imgly_transforms_common.imgly_transform_common_16-9","pesdk.transform.asset.imgly_transforms_common.imgly_transform_common_4-3":"editor.controls.transform.ratios.imgly_transforms_common.imgly_transform_common_4-3","pesdk.transform.asset.imgly_transforms_common.imgly_transform_common_custom":"editor.controls.transform.ratios.imgly_transforms_common.imgly_transform_common_custom","pesdk.transform.asset.imgly_transforms_common.imgly_transform_common_square":"editor.controls.transform.ratios.imgly_transforms_common.imgly_transform_common_square","pesdk.transform.asset.imgly_transforms_common.name":"editor.controls.transform.ratios.imgly_transforms_common.name","pesdk.transform.asset.imgly_transforms_facebook.imgly_transform_facebook_ad":"editor.controls.transforms.ratios.imgly_transforms_facebook.imgly_transform_facebook_ad","pesdk.transform.asset.imgly_transforms_facebook.imgly_transform_facebook_cover":"editor.controls.transforms.ratios.imgly_transforms_facebook.imgly_transform_facebook_cover","pesdk.transform.asset.imgly_transforms_facebook.imgly_transform_facebook_post":"editor.controls.transforms.ratios.imgly_transforms_facebook.imgly_transform_facebook_post","pesdk.transform.asset.imgly_transforms_facebook.imgly_transform_facebook_profile":"editor.controls.transforms.ratios.imgly_transforms_facebook.imgly_transform_facebook_profile","pesdk.transform.asset.imgly_transforms_facebook.name":"editor.controls.transform.ratios.imgly_transforms_facebook.name","pesdk.transform.button.reset":"editor.controls.transform.reset","pesdk.transform.placeholder.height":"editor.controls.transform.dimensions.height","pesdk.transform.placeholder.width":"editor.controls.transform.dimensions.width","pesdk.transform.title.name":"editor.controls.transform.title"}},function(e,t,n){"use strict";var i=n(78),r=n(223);t.a={EVENTS:i.a,DEFAULTS:r.a}},function(e,t,n){"use strict";t.a=[{defaultName:"Natasha Wescoat",identifier:"imgly_art_filter_june_tree",rootPath:"art-filters/imgly_june_tree",thumbnail:"art-filters/imgly_june_tree/thumbnail.jpg"},{defaultName:"Hive",identifier:"imgly_art_filter_hive",rootPath:"art-filters/imgly_hive",thumbnail:"art-filters/imgly_hive/thumbnail.jpg"},{defaultName:"Udnie",identifier:"imgly_art_filter_udnie",rootPath:"art-filters/imgly_udnie",thumbnail:"art-filters/imgly_udnie/thumbnail.jpg"},{defaultName:"Vince Low",identifier:"imgly_art_filter_vince_low",rootPath:"art-filters/imgly_vince_low",thumbnail:"art-filters/imgly_vince_low/thumbnail.jpg"},{defaultName:"Mosaic",identifier:"imgly_art_filter_mosaic",rootPath:"art-filters/imgly_mosaic",thumbnail:"art-filters/imgly_mosaic/thumbnail.jpg"},{defaultName:"Wave",identifier:"imgly_art_filter_wave",rootPath:"art-filters/imgly_wave",thumbnail:"art-filters/imgly_wave/thumbnail.jpg"},{defaultName:"Malikova Darya",identifier:"imgly_art_filter_watercolor",rootPath:"art-filters/imgly_watercolor",thumbnail:"art-filters/imgly_watercolor/thumbnail.jpg"}]},function(e,t,n){"use strict";var i=n(7),r=n.n(i),o=n(224),a=n(225),s=n(226),l=[];void 0!==r.a.Operations.SpriteOperation&&l.push(r.a.Operations.SpriteOperation.BrushSprite.Brushes.RadialBrush),t.a={TRANSFORM_RATIO_CATEGORIES:s.a,FONTS:o.a,TEXT_DESIGN_FONTS:a.a,BRUSHES:l}},function(e,t,n){"use strict";t.a=[{fontFamily:"Aleo",variations:[{identifier:"imgly_font_aleo_bold",fontWeight:"bold",provider:"file",filePath:"fonts/imgly_font_aleo_bold.woff",textMetrics:{unitsPerEm:2048,ascender:1919,descender:-409}}]},{fontFamily:"Amatic SC",variations:[{identifier:"imgly_font_amaticsc",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_amaticsc.woff",textMetrics:{unitsPerEm:2048,ascender:2332,descender:-583}}]},{fontFamily:"Bernier",variations:[{identifier:"imgly_font_bernier_regular",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_bernier_regular.woff",textMetrics:{unitsPerEm:2048,ascender:2007,descender:-552}}]},{fontFamily:"Cheque",variations:[{identifier:"imgly_font_cheque_regular",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_cheque_regular.woff",textMetrics:{unitsPerEm:2048,ascender:1853,descender:-495}}]},{fontFamily:"Open Sans",variations:[{identifier:"imgly_font_open_sans_bold",fontWeight:"bold",provider:"file",filePath:"fonts/imgly_font_open_sans_bold.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2189,descender:-640}}]},{fontFamily:"Gagalin",variations:[{identifier:"imgly_font_gagalin_regular",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_gagalin_regular.woff",textMetrics:{unitsPerEm:2048,ascender:1987,descender:-628}}]},{fontFamily:"Hagin",variations:[{identifier:"imgly_font_hagin_caps_thin",fontWeight:200,provider:"file",filePath:"fonts/imgly_font_hagin_caps_thin.woff",textMetrics:{unitsPerEm:2048,ascender:1964,descender:-482}}]},{fontFamily:"Intro",variations:[{identifier:"imgly_font_intro_inline",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_intro_inline.woff",textMetrics:{unitsPerEm:2048,ascender:1944,descender:-548}}]},{fontFamily:"Lobster",variations:[{identifier:"imgly_font_lobster",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_lobster.woff",textMetrics:{unitsPerEm:2048,ascender:2048,descender:-552}}]},{fontFamily:"Nexa",variations:[{identifier:"imgly_font_nexa_script",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_nexa_script.woff",textMetrics:{unitsPerEm:2048,ascender:1835,descender:-663}}]},{fontFamily:"Ostrich",variations:[{identifier:"imgly_font_ostrich_sans_black",fontWeight:800,provider:"file",filePath:"fonts/imgly_font_ostrich_sans_black.woff",textMetrics:{unitsPerEm:2048,ascender:1513,descender:-235}},{identifier:"imgly_font_ostrich_sans_bold",fontWeight:"bold",provider:"file",filePath:"fonts/imgly_font_ostrich_sans_bold.woff",textMetrics:{unitsPerEm:2048,ascender:1513,descender:-235}}]},{fontFamily:"Panton",variations:[{identifier:"imgly_font_panton_black_italic_caps",fontWeight:800,fontStyle:"italic",provider:"file",filePath:"fonts/imgly_font_panton_blackitalic_caps.woff",textMetrics:{unitsPerEm:2048,ascender:2033,descender:-572}},{identifier:"imgly_font_panton_light_italic_caps",fontWeight:200,fontStyle:"italic",provider:"file",filePath:"fonts/imgly_font_panton_lightitalic_caps.woff",textMetrics:{unitsPerEm:2048,ascender:1961,descender:-556}}]},{fontFamily:"Perfograma",variations:[{identifier:"imgly_font_perfograma",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_perfograma.woff",textMetrics:{unitsPerEm:2048,ascender:1982,descender:-842}}]},{fontFamily:"Trashhand",variations:[{identifier:"imgly_font_trash_hand",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_trash_hand.woff",textMetrics:{unitsPerEm:2048,ascender:1554,descender:-663}}]}]},function(e,t,n){"use strict";t.a=[{fontFamily:"Open Sans",variations:[{identifier:"imgly_font_open_sans_bold",fontWeight:"bold",provider:"file",filePath:"fonts/imgly_font_open_sans_bold.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2189,descender:-640}}]},{fontFamily:"Gagalin",variations:[{identifier:"imgly_font_gagalin_regular",fontWeight:"normal",provider:"file",filePath:"fonts/imgly_font_gagalin_regular.woff",textMetrics:{unitsPerEm:2048,ascender:1987,descender:-628}}]},{fontFamily:"Abril Fatface",variations:[{identifier:"imgly_font_abril_fatface_regular",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_abril_fatface_regular.woff",textMetrics:{unitsPerEm:1e3,ascender:1058,descender:-291}}]},{fontFamily:"Montserrat Light",variations:[{identifier:"imgly_font_montserrat_light",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_montserrat_light.woff",textMetrics:{unitsPerEm:1e3,ascender:968,descender:-251}}]},{fontFamily:"Wolesbro",variations:[{identifier:"imgly_font_wolesbro",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_wolesbro.woff",textMetrics:{unitsPerEm:2048,ascender:1849,descender:-1123}}]},{fontFamily:"Permanent Marker",variations:[{identifier:"imgly_font_permanent_marker",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_permanent_marker.woff",textMetrics:{unitsPerEm:2048,ascender:2272,descender:-686}}]},{fontFamily:"Panton Caps",variations:[{identifier:"imgly_font_panton_light_italic_caps",fontWeight:"lighter",fontStyle:"italic",provider:"file",filePath:"text-design/fonts/imgly_font_panton_light_italic_caps.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:940,descender:-260}},{identifier:"imgly_font_panton_black_italic_caps",fontWeight:800,fontStyle:"italic",provider:"file",filePath:"text-design/fonts/imgly_font_panton_black_italic_caps.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:940,descender:-260}},{identifier:"imgly_font_panton_light_caps",fontWeight:"lighter",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_panton_light_caps.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:940,descender:-260}},{identifier:"imgly_font_panton_black_caps",fontWeight:800,fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_panton_black_caps.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:940,descender:-260}}]},{fontFamily:"Amberlight",variations:[{identifier:"imgly_font_amberlight",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_amberlight.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:750,descender:-250}}]},{fontFamily:"Ultra",variations:[{identifier:"imgly_font_ultra",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_ultra.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2066,descender:-561}}]},{fontFamily:"Galano Grotesque",variations:[{identifier:"imgly_font_galano_grotesque_bold",fontWeight:"bold",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_galano_grotesque_bold.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:800,descender:-200}}]},{fontFamily:"Bungee Inline",variations:[{identifier:"imgly_font_bungee_inline",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_bungee_inline.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:860,descender:-140}}]},{fontFamily:"Petit Formal Script",variations:[{identifier:"imgly_font_petit_formal_script",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_petit_formal_script.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2033,descender:-527}}]},{fontFamily:"Summer Font",variations:[{identifier:"imgly_font_summer_font_light",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_summer_font_light.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2189,descender:-600}}]},{fontFamily:"Handycheera",variations:[{identifier:"imgly_font_handycheera_regular",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_handycheera_regular.woff",default:!0,textMetrics:{unitsPerEm:2048,ascender:2199,descender:-808}}]},{fontFamily:"Rasa",variations:[{identifier:"imgly_font_rasa_regular",fontWeight:"normal",fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_rasa_regular.woff",default:!0,textMetrics:{unitsPerEm:2750,ascender:2300,descender:-1050}},{identifier:"imgly_font_rasa_500",fontWeight:500,fontStyle:"normal",provider:"file",filePath:"text-design/fonts/imgly_font_rasa_500.woff",default:!0,textMetrics:{unitsPerEm:2750,ascender:2300,descender:-1050}}]},{fontFamily:"Campton Book",variations:[{identifier:"imgly_font_campton_bold",fontWeight:"bold",provider:"file",filePath:"text-design/fonts/imgly_font_campton_bold.woff",default:!0,textMetrics:{unitsPerEm:1e3,ascender:770,descender:-294}}]},{fontFamily:"Ostrich",variations:[{identifier:"imgly_font_ostrich_sans_black",fontWeight:800,provider:"file",filePath:"fonts/imgly_font_ostrich_sans_black.woff",textMetrics:{unitsPerEm:2048,ascender:1513,descender:-235}},{identifier:"imgly_font_ostrich_sans_bold",fontWeight:"bold",provider:"file",filePath:"fonts/imgly_font_ostrich_sans_bold.woff",textMetrics:{unitsPerEm:2048,ascender:1513,descender:-235}},{identifier:"imgly_font_ostrich_sans_heavy",fontWeight:900,provider:"file",filePath:"text-design/fonts/imgly_font_ostrich_sans_heavy.woff",textMetrics:{unitsPerEm:1e3,ascender:674,descender:0}}]}]},function(e,t,n){"use strict";t.a=[{identifier:"imgly_transforms_common",defaultName:"Common Ratios",ratios:[{identifier:"imgly_transform_common_custom",defaultName:"Custom",ratio:"*",selected:!0},{identifier:"imgly_transform_common_square",defaultName:"Square",ratio:1},{identifier:"imgly_transform_common_4-3",defaultName:"4:3",ratio:4/3},{identifier:"imgly_transform_common_16-9",defaultName:"16:9",ratio:16/9}]},{identifier:"imgly_transforms_facebook",defaultName:"Facebook",ratios:[{identifier:"imgly_transform_facebook_profile",defaultName:"Profile Pic",dimensions:{x:300,y:300},forceDimensions:!1,lockDimensions:!0},{identifier:"imgly_transform_facebook_ad",defaultName:"Ad",dimensions:{x:1200,y:627}},{identifier:"imgly_transform_facebook_post",defaultName:"Post",dimensions:{x:940,y:788}},{identifier:"imgly_transform_facebook_cover",defaultName:"Cover",dimensions:{x:851,y:315}}]}]},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(41),a=n.n(o),s=n(42),l=n.n(s),c=n(0),u=n.n(c),f=n(2),p=n.n(f),d=n(3),h=n.n(d),_=n(1),m=n.n(_),g=n(7),y=n.n(g),v=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},b="function"==typeof l.a&&"symbol"==typeof a.a?function(e){return typeof e}:function(e){return e&&"function"==typeof l.a&&e.constructor===l.a&&e!==l.a.prototype?"symbol":typeof e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),u()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=y.a.EventEmitter,S=y.a.Log,C=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||m()(t)).call(this));return n.setMaxListeners(50),n._canBroadcast=!0,n.state=e,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(p.a?p()(e,t):e.__proto__=t)}(t,w),k(t,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"object"!==(void 0===e?"undefined":b(e))&&S.info("SharedState#set expects an object as first parameter");var n=v({},this.state,e),i=v({},this.state);this.state=n,t&&this.broadcastUpdate(i,n)}},{key:"get",value:function(e){return e?this.state[e]:v({},this.state)}},{key:"getState",value:function(){return this.state}},{key:"broadcastUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._canBroadcast&&this.emit("update",e,t)}},{key:"enableBroadcast",value:function(){this._canBroadcast=!0}},{key:"disableBroadcast",value:function(){this._canBroadcast=!1}},{key:"clear",value:function(){var e=this.state;this.state={},this.broadcastUpdate(e,this.state)}}]),t}();t.a=C},function(e,t,n){n(50),n(40),e.exports=n(229)},function(e,t,n){var i=n(71),r=n(13)("iterator"),o=n(31);e.exports=n(10).isIterable=function(e){var t=Object(e);return void 0!==t[r]||"@@iterator"in t||o.hasOwnProperty(i(t))}},function(e,t,n){n(50),n(40),e.exports=n(231)},function(e,t,n){var i=n(14),r=n(72);e.exports=n(10).getIterator=function(e){var t=r(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return i(t.call(e))}},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(44),g=n(235),y=n(241),v=n(288),b=n(96),k=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),S=function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},C={loading:v.a,editor:y.a},E=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onLoadingDone","_onPreloaderDone","_onImageDone");var a=o.props,s=a.options,l=a.ui,c=s.editor.image;o._preloaderIsComplete=!s.preloader,s.preloader&&(o._preloader=l.getPreloader(),o._preloader.on("done",o._onPreloaderDone)),o._imageIsComplete=c.complete,c.addEventListener("load",o._onImageDone);var u=o._preloaderIsComplete&&o._imageIsComplete?y.a:v.a;return o.state={theme:o.props.ui.getTheme(),screen:u,screenOptions:{}},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,b.a),w(t,[{key:"componentDidMount",value:function(){S(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this._preloader&&this._preloader.load()}},{key:"componentWillUnmount",value:function(){S(t.prototype.__proto__||h()(t.prototype),"componentWillUnmount",this).call(this),this._preloader&&this._preloader.off("done",this._onPreloaderDone)}},{key:"_onImageDone",value:function(){this._imageIsComplete=!0,this._onLoadingDone()}},{key:"_onPreloaderDone",value:function(){this._preloaderIsComplete=!0,this._onLoadingDone()}},{key:"_onLoadingDone",value:function(){this._preloaderIsComplete&&this._imageIsComplete&&this.setState({screen:y.a,screenOptions:{}})}},{key:"getChildContext",value:function(){return{ui:this.props.ui,options:this.props.options,mediator:this.props.mediator,globalState:this.props.globalState,appComponent:this}}},{key:"switchToScreen",value:function(e){this.setState({screen:C[e],screenOptions:{}})}},{key:"getEditor",value:function(){return this._currentScreen.getEditor()}},{key:"export",value:function(){var e;return(e=this._currentScreen).export.apply(e,arguments)}},{key:"serialize",value:function(){var e;return(e=this._currentScreen).serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return this._currentScreen.deserialize(e)}},{key:"getBounds",value:function(){return this._container.getBoundingClientRect()}},{key:"setImage",value:function(e){this.getEditor().setImage(e)}},{key:"_renderCurrentScreen",value:function(){var e=this,t=this.state,n=t.screen,i=t.screenOptions;return _.m.createElement(n,k({},i,{innerRef:function(t){e._currentScreen=t}}))}},{key:"render",value:function(){var e=this;return _.m.createElement(_.u,{theme:this.state.theme},_.m.createElement(x,{className:"photoeditorsdk-editor",innerRef:function(t){e._container=t}},_.m.createElement(g.a,{modalManager:m.a.instance}),this._renderCurrentScreen()))}}]),t}();E.childContextTypes={ui:_.k.object.isRequired,mediator:_.k.object.isRequired,options:_.k.object.isRequired,appComponent:_.k.object.isRequired,globalState:_.k.object.isRequired},E.propTypes={ui:_.k.object.isRequired,mediator:_.k.object.isRequired,globalState:_.k.object.isRequired,options:_.k.object.isRequired},t.a=E;var x=_.x.div("1fw137a","AppContainer")},function(e,t,n){n(234);var i=n(10).Object;e.exports=function(e,t){return i.getOwnPropertyDescriptor(e,t)}},function(e,t,n){var i=n(19),r=n(63).f;n(48)("getOwnPropertyDescriptor",function(){return function(e,t){return r(i(e),t)}})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(236),_=n(237),m=n(238),g=n(239),y=n(240),v=n(53),b=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),k=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},w=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._onOverlayClick=function(){o._modalManager.getModals().forEach(function(e){e.closeOnOverlayClick&&e.close()})},o._modalManager=o.props.modalManager,o._bindAll("_onModalManagerUpdate"),o.state={overlayVisible:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),b(t,[{key:"componentDidMount",value:function(){k(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._modalManager.on("update",this._onModalManagerUpdate)}},{key:"componentWillUnmount",value:function(){k(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),this._modalManager.off("update",this._onModalManagerUpdate)}},{key:"_onModalManagerUpdate",value:function(){var e=this._modalManager.getModals().filter(function(e){return e.visible}).filter(function(e){return!!e.overlay}).length>0;this.state.overlayVisible=e,this.forceUpdate()}},{key:"_onModalClosed",value:function(e){this._modalManager.removeModal(e)}},{key:"_renderModals",value:function(){var e=this;return this._modalManager.getModals().map(function(t){var n=void 0;switch(t.type){case"loading":n=h.a;break;case"warning":n=_.a;break;case"error":n=m.a;break;case"input":n=y.a;break;case"progress":n=g.a}return d.m.createElement(n,{modal:t,key:t.id,onClose:e._onModalClosed.bind(e,t)})})}},{key:"render",value:function(){return d.m.createElement(C,null,d.m.createElement(v.a,{active:this.state.overlayVisible,enterProp:"rendered",enterDuration:1e3*this.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*this.context.theme.transitionDuration,leaveDuration:1e3*this.context.theme.transitionDuration},d.m.createElement(S,{onClick:this._onOverlayClick})),d.m.createElement("div",null,this._renderModals()))}}]),t}();w.contextTypes=d.b.contextTypes,t.a=w;var S=d.x.div("ovs9m3",{visible:"zgbg08",rendered:"2jlos"},"Overlay"),C=d.x.div("8gacw5","Container")},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(4),u=n(45),f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,u.g),t}();f.contextTypes=c.b.contextTypes,t.a=f},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(45),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._buttons=o.props.modal.data.buttons||["OK"],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.g),d(t,[{key:"_onButtonClick",value:function(e){this.props.modal.emit("button",e),this.props.modal.close()}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(45),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._buttons=["Okay"],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.g),d(t,[{key:"_onButtonClick",value:function(e){0===e&&this.props.modal.close()}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(45),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.g),d(t,[{key:"_getProgressBarStyle",value:function(e){return{right:100*(1-e)+"%",borderRadius:"0 0 "+(1===e?2:0)+"px 2px"}}},{key:"_renderContent",value:function(){var e=this.props.modal;return f.m.createElement(p.f,null,f.m.createElement(p.b,null,f.m.createElement(p.a,{src:this._getAssetPath("shared/modals/icon.png",!0)})),f.m.createElement(p.d,null,f.m.createElement(p.e,null,e.title),f.m.createElement(p.c,null,e.text)),f.m.createElement(_,{style:this._getProgressBarStyle(e.data.progress)}))}}]),t}();h.propTypes={modal:f.k.object},h.contextTypes=f.b.contextTypes,t.a=h;var _=f.x.div("1j1uq6u","ProgressBar")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(45),_=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._onKeyPress=function(e){"Enter"===e.key?o._onAccept():o.setState(function(e){return{count:e.count+1}})},o._onAccept=function(){o.props.modal.emit("input",o._textArea.value),o.props.modal.close()},o._onCancel=function(){var e=o.props.modal;e.emit("input",e.data.text||""),e.emit("cancel"),e.close()},o._onClickOverlay=function(){o._onCancel()},o._buttons=o.props.modal.data.buttons||["OK"],o.state=_({},o.state,{count:0,large:!0}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.g),m(t,[{key:"_renderContent",value:function(){var e=this,t=this.props.modal;return d.m.createElement(S,null,d.m.createElement(v,null,d.m.createElement(k,null,t.title),d.m.createElement(w,{autoFocus:!0,innerRef:function(t){e._textArea=t},defaultValue:t.data.text||"",onKeyPress:this._onKeyPress})),d.m.createElement(y,null,d.m.createElement(b,{onClick:this._onAccept,right:!0,src:this._getAssetPath("shared/modals/input-accept.png",!0)}),d.m.createElement(b,{onClick:this._onCancel,src:this._getAssetPath("shared/modals/input-cancel.png",!0)})))}}]),t}();g.contextTypes=d.b.contextTypes,t.a=g;var y=d.x.div("dh53lm","ButtonBar"),v=d.x.div("1uahxoo","InputContainer"),b=d.x.img("1pb8m8c",{right:"1l7kz3k"},"Image"),k=d.x.div("1lyqewl","Title"),w=d.x.textarea("93mi9g","TextArea"),S=(d.x.span("19kk1u4","LetterCount"),d.x.div("11xw2tg","Container"))},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(112),g=n(279),y=n(281),v=n(44),b=n(141),k=n(142),w=n(84),S=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),C=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},E=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onRenderError","_onImageResize","_startEditor","_onEditorReset");var a=o.context,s=a.ui,l=a.options,c=a.mediator;return o._editor=new m.a(s,l,c),o._editor.on("ready",o._startEditor),o._editor.on("render-error",o._onRenderError),o._editor.on("resize",o._onImageResize),o._editor.on("reset",o._onEditorReset),o._onWindowResize=_.v.debounce(o._onWindowResize.bind(o),250),o._originalToolsOption=null,o._needsForceCrop=!1,o._isReady=!1,o.state={sharedState:new _.t,controls:null,controlsOptions:{},currentControl:null},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.b),S(t,[{key:"componentDidMount",value:function(){var e=this;C(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this.context.options.responsive&&window.addEventListener("resize",this._onWindowResize),this._editor.isReady()?!this._hasSwitchedControls&&this.switchToInitialControls():this._editor.once("ready",function(){!e._hasSwitchedControls&&e.switchToInitialControls()})}},{key:"componentWillUnmount",value:function(){C(t.prototype.__proto__||h()(t.prototype),"componentWillUnmount",this).call(this),this.context.options.responsive&&window.removeEventListener("resize",this._onWindowResize)}},{key:"_onEditorReset",value:function(){"library"!==this.state.currentControl&&this.switchToInitialControls(null,!0)}},{key:"_onImageResize",value:function(){var e=this,t=v.a.instance.displayLoading(this._t("pesdk.editor.text.resizing"));this._editor.once("resized",function(n){var i=n.dimensions,r=n.reason;t.close(),e.context.options.editor.displayResizeMessage&&v.a.instance.displayWarning(e._t("pesdk.editor.title.imageResizedWarning_"+r),e._t("pesdk.editor.text.imageResizedWarning_"+r,{maxMegaPixels:e._editor.getMaxMegapixels(),width:i.x,height:i.y}))})}},{key:"_onRenderError",value:function(e){v.a.instance.displayError(this._t("pesdk.common.title.error"),this._t("pesdk.editor.text.renderingError"),!0)}},{key:"_onWindowResize",value:function(){this._emitEvent(_.d.EVENTS.WINDOW_RESIZE);var e=new _.w(this._container.offsetWidth,this._container.offsetHeight);this._emitEvent(_.d.EVENTS.EDITOR_RESIZE,e)}},{key:"switchToInitialControls",value:function(e,t){var n=this.context.options,i=!1;if(n.editor.forceCrop&&this._editor.controls.isEnabled("transform")&&!this._hasSwitchedControls){var r=this._editor.getInputDimensions(),o=new b.a(n.editor.controlsOptions.transform||{}),a=r.x/r.y;i=!o.hasRatioValue(a)}i?(this._needsForceCrop=!0,this.switchToForceCropControls(e,t)):(this._needsForceCrop=!1,this.switchToDefaultControls(e,t))}},{key:"switchToDefaultControls",value:function(e,t){var n=this.context.options,i=n.editor.defaultControl;this._originalToolsOption&&(n.editor.tools=this._originalToolsOption,this._originalToolsOption=null),this._editor.controls.isEnabled(i)||(_.h.warn("Trying to switch to default control `"+i+"` which is not available. Falling back to first available control."),i=this._editor.controls.getFirstEnabledControlName()),this.switchToControls(i,null,null,e,t)}},{key:"switchToForceCropControls",value:function(e,t){var n=this.context.options,i=n.editor.tools;this._originalToolsOption||(this._originalToolsOption=i,n.editor.tools=_.r.Array.remove(i,function(e){return"transform"!==e&&"library"!==e})),this.switchToControls("transform",{forceCrop:!0},null,e,t)}},{key:"switchToControls",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2],i=this,r=arguments[3],o=arguments[4];if(!o&&this.state.currentControl===e)return r&&r();var a=this.state.controlsComponentKey||0;o&&a++,this._hasSwitchedControls=!0;var s=this.state.sharedState;if("default"===e)return this.switchToDefaultControls(r);if(!this._editor.controls.isEnabled(e))return _.h.warn("Tried to open control `"+e+"` which is not available.");var l=this._editor.controls.getAvailable()[e];if(!l&&"overview"!==e)return _.h.error("Control `"+e+"` does not exist!");var c=p.a.resolve(!0);this.state.controls&&(c=this.state.controls.onLeave()),c.then(function(o){if(o){s.disableBroadcast(),i._isReady||(i._isReady=!0,i.context.mediator.emit(_.d.EVENTS.EDITOR_READY)),s.disableBroadcast(),s.clear(),s.set(t);var c=_.r.defaults(n||i.context.options.editor.controlsOptions[l.identifier],l.defaultOptions),u=new l(i.getChildContext(),i.state.sharedState,c);u.onEnter(),s.enableBroadcast(),i.setState({controls:u,controlsOptions:c,currentControl:e,controlsComponentKey:a},r)}})}},{key:"refreshControlsComponent",value:function(){var e=(this.state.controlsComponentKey||0)+1;this.setState({controlsComponentKey:e}),this.forceUpdate()}},{key:"_startEditor",value:function(){var e=this.context.options;this._editor.start(),e.editor.forceCrop&&(this._hasSwitchedControls=!1,this.switchToInitialControls())}},{key:"getChildContext",value:function(){return{editor:this._editor,ui:this.context.ui,options:this.context.options,mediator:this.context.mediator,sharedState:this.state.sharedState,screen:this,appComponent:this.context.appComponent,globalState:this.context.globalState}}},{key:"render",value:function(){var e=this,t=this.state,n=t.controls,i=t.controlsOptions,r=t.controlsComponentKey,o=void 0,a=void 0;if(n){var s=n.constructor,l=s.controlsComponent,c=s.canvasControlsComponent;o=l?_.m.createElement(l,{key:r,options:i,controls:n}):_.m.createElement("div",null),a=c?_.m.createElement(c,{options:i,controls:n}):_.m.createElement("div",null)}else o=_.m.createElement(k.a,null),a=_.m.createElement(w.a,null);return _.m.createElement(x,{innerRef:function(t){t&&(e._container=t)},className:void 0},_.m.createElement(y.a,{ref:"canvas"}),_.m.createElement(T,{innerRef:function(t){e._tableContainer=t}},_.m.createElement(g.a,{onControlSwitch:this.switchToControls.bind(this),currentControl:this.state.currentControl}),o,a))}},{key:"getEditor",value:function(){return this._editor}},{key:"export",value:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return new p.a(function(t,i){e.switchToControls("default",null,{},function(){var r;(r=e._editor).export.apply(r,n).then(t).catch(i)})})}},{key:"serialize",value:function(){var e;return(e=this._editor).serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return this._editor.deserialize(e)}}]),t}();E.contextTypes=_.b.contextTypes,E.childContextTypes={ui:_.k.object.isRequired,editor:_.k.object.isRequired,mediator:_.k.object.isRequired,options:_.k.object.isRequired,sharedState:_.k.object.isRequired,screen:_.k.object.isRequired,appComponent:_.k.object.isRequired,globalState:_.k.object.isRequired};var x=_.x.div("5x8wsv","Container"),T=_.x.div("1wu5p5w","TableContainer");t.a=Object(_.B)(E)},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=n(113),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._sdk=t,this._options=n,this._download=i}return s(e,[{key:"export",value:function(){var e=this,t=this._getRenderType();return this._sdk.export(t,this._options.format,this._options.quality).then(function(n){return e._download&&e._downloadData(t,n),n})}},{key:"_downloadData",value:function(e,t){switch(e){case o.p.DATAURL:a.a.downloadDataURL(t,this._options.fileBasename);break;case o.p.MSBLOB:a.a.downloadMSBlob(t,this._options.fileBasename)}}},{key:"_getRenderType",value:function(){var e=this._options;return e.type===o.p.IMAGE&&this._download?o.v.supportsMSBlob()?o.p.MSBLOB:o.p.DATAURL:e.type}}]),e}();t.a=l},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._image=t,this._maxPixels=n,this._maxDimensions=i}return a(e,[{key:"needsResize",value:function(){var e=new o.w(this._image.width,this._image.height),t=e.x*e.y>this._maxPixels,n=null!==this._maxDimensions&&(e.x>this._maxDimensions||e.y>this._maxDimensions);return t||n}},{key:"resize",value:function(){var e=this,t=null,n=null,i=this._maxDimensions;return new o.j(function(r,a){window.setTimeout(function(){var a=new o.w(e._image.width,e._image.height).clone();if(a.x*a.y>e._maxPixels&&(a.copy(e._getDimensionsByMaxPixels()),t="maxMegaPixels"),null!==i&&(a.x>i||a.y>i)){var s=Math.min(i/a.x,i/a.y);a.multiply(s),t="maxDimensions"}a.floor(),n=e._createResizedImageCanvas(a),r({canvas:n,dimensions:a,reason:t})},1e3)})}},{key:"_createResizedImageCanvas",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this._image,i=document.createElement("canvas");i.width=e.x,i.height=e.y;var r=e.clone().subtract(t).divide(2);return i.getContext("2d").drawImage(n,0,0,n.width,n.height,r.x,r.y,t.x,t.y),i}},{key:"_getDimensionsByMaxPixels",value:function(){var e=this._image,t=this._maxPixels,n=e.width/e.height,i=e.height/e.width;return new o.w(Math.sqrt(t*n),Math.sqrt(t*i)).floor()}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(41),r=n.n(i),o=n(42),a=n.n(o),s=n(0),l=n.n(s),c=n(43),u=n.n(c),f=n(7),p=n.n(f),d=n(4),h="function"==typeof a.a&&"symbol"==typeof r.a?function(e){return typeof e}:function(e){return e&&"function"==typeof a.a&&e.constructor===a.a&&e!==a.a.prototype?"symbol":typeof e},_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),l()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(){function e(t,n,i){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t,this._sdk=n,this._mediator=i,this._map={},this._stack=this._sdk&&this._sdk.getOperationsStack(),this._preferredOrder=this._editor.getOptions().editor.operationsOrder,this._available={};var o=p.a.Operations;for(var a in o){var s=o[a];this._available[s.identifier]=s}t.getOptions().extensions.operations.forEach(function(e){r._available[e.identifier]=e}),this._stack&&this._fixStack()}return _(e,[{key:"exists",value:function(e){return!!this._map[e]}},{key:"add",value:function(e){var t=this,n=e.constructor.identifier;e.on("update",function(){t._mediator.emit(d.d.EVENTS.OPERATION_UPDATED,e)});var i=this._preferredOrder.indexOf(n);if(-1===i)throw new Error("EditorOperations#add: `"+n+"` does not appear in `operationsOrder`");this._stack.set(i,e),this._map[n]=e,this._mediator.emit(d.d.EVENTS.OPERATION_CREATED,e)}},{key:"remove",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="object"===(void 0===e?"undefined":h(e))?e.constructor.identifier:e,i=this._stack.getStack();e=this.get(n),delete this._map[n];var r=i.map(function(e){return e.constructor.identifier}).indexOf(n);if(-1!==r){this._stack.removeAt(r);for(var o=r+1;o<i.length;o++){var a=i[o];a&&a.setDirty(!0)}t&&this._mediator.emit(d.d.EVENTS.OPERATION_REMOVED,e)}}},{key:"get",value:function(e){return this._map[e]}},{key:"getOrCreate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._map[e]){var n=this._map[e];return n.set(t,!1),n}var i=this._available[e];if(void 0===i)return d.h.warn("Trying to create an operation of type `"+e+"` that is not available."),null;var r=new i(this._sdk,t);return this.add(r),r}},{key:"getStack",value:function(){return this._stack}},{key:"getSnapshot",value:function(){var e=this,t={};return u()(this._map).forEach(function(n){var i=e._map[n];t[n]=i.serializeOptions()}),t}},{key:"removeUnused",value:function(){var e=this;u()(this._map).forEach(function(t){var n=e._map[t];n.hasChanges()||e.remove(n)})}},{key:"hasChanges",value:function(e){var t=this,n=!1;return u()(this._map).forEach(function(t){e[t]||(n=!0)}),!!n||(u()(e).forEach(function(i){var r=t.get(i);r&&r.optionsEqual(e[i])||(n=!0)}),n)}},{key:"restoreSnapshot",value:function(e){var t=this;u()(e).forEach(function(n){var i=t.getOrCreate(n);i.optionsEqual(e[n])||(i.restoreSnapshot?i.restoreSnapshot(e[n]):i.set(e[n]))}),u()(this._map).forEach(function(n){e[n]||t.remove(n)})}},{key:"isAvailable",value:function(e){return!!this._available[e]}},{key:"getAvailable",value:function(){return this._available}},{key:"reset",value:function(){this._map={}}},{key:"_fixStack",value:function(){var e=this,t=this._stack.getStack().slice();this._stack.clear(),t.forEach(function(t){e.add(t)})}}]),e}();t.a=m},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(7),a=n.n(o),s=n(4),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(t,n,i){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t,this._sdk=n,this._mediator=i,this._options=this._editor.getOptions(),this._invalidOperationsSeen=[],this._available={};var o=a.a.UI.DesktopUI.Controls;for(var s in o){var l=o[s];this._available[l.identifier]=l}(this._options.extensions.controls||[]).forEach(function(e){r._available[e.identifier]=e})}return l(e,[{key:"getFirstEnabledControlName",value:function(){for(var e in this._available)if(this.isEnabled(e))return e;return null}},{key:"isEnabled",value:function(e){var t=this,n=this.get(e);if(!n)return s.h.info("EditorControls#isEnabled: Unknown control: "+e),!1;var i=[];return(n.requiredOperations||[]).forEach(function(e){t._editor.operations.isAvailable(e)||i.push(e)}),i.length?(-1===this._invalidOperationsSeen.indexOf(e)&&(this._invalidOperationsSeen.push(e),s.h.error("Control `"+e+"` can not be used because "+(1===i.length?"operation is":"operations are")+" missing: "+i.map(function(e){return"`"+e+"`"}).join(", "))),!1):n.isEnabled(this._editor)}},{key:"get",value:function(e){return this._available[e]}},{key:"getAvailable",value:function(){return this._available}}]),e}();t.a=c},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(4),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t,this._sdk=n,this._mediator=i,this._options=this._editor.getOptions(),this.reset()}return a(e,[{key:"isEnabled",value:function(e){return this._features[e]&&this.isEnabledByOptions(e)}},{key:"isEnabledByOptions",value:function(e){var t=e.charAt(0).toUpperCase()+e.slice(1),n=this._options.editor["enable"+t];return void 0===n&&(n=!0),n}},{key:"enable",value:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(t){e._features[t]=!0}),this._mediator.emit(o.d.EVENTS.FEATURES_ENABLED,n),this._mediator.emit(o.d.EVENTS.FEATURES_UPDATED,n)}},{key:"disable",value:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(t){e._features[t]=!1}),this._mediator.emit(o.d.EVENTS.FEATURES_DISABLED,n),this._mediator.emit(o.d.EVENTS.FEATURES_UPDATED,n)}},{key:"reset",value:function(){this._features={drag:this._options.editor.enableDrag,zoom:this._options.editor.enableZoom,export:this._options.editor.enableExport,new:this._options.editor.enabledNew,save:this._options.editor.enableSave,load:this._options.editor.enableLoad}}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(248),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).call(this));return r._editor=e,r._sdk=n,r._mediator=i,r._isDefaultZoom=!1,r._zoom=r._sdk.getZoom(),r._targetZoom=r._zoom,r._options=r._editor.getOptions(),r._zoomLevels=[1,2,3,4,5,6.25,8.33,12.5,16.66,25,33.33,50,66.66,100,200,300,400,500,600,700,800,1200,1600,3200].map(function(e){return e/100}),r._editor.on("ready",function(){r._defaultLevel=r._calculateDefaultZoomLevel()}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.e),d(t,[{key:"auto",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments[2];e&&(this._defaultLevel=this._calculateDefaultZoomLevel()),this.set(this._defaultLevel,t,n)}},{key:"in",value:function(e){var t=this._getClosestZoomLevel(this._targetZoom+.001,1);t=this._clamp(t),this.set(t,e)}},{key:"out",value:function(e){var t=this._getClosestZoomLevel(this._targetZoom-.001,-1);t=this._clamp(t),this.set(t,e)}},{key:"_clamp",value:function(e){var t=this._calculateDefaultZoomLevel(),n=Math.max(1,2*t),i=this.minimum;return Math.max(i,Math.min(n,e))}},{key:"set",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments[2];this._targetZoom=e,this._mediator.emit(f.d.EVENTS.ZOOM,e),this._zoom===this._targetZoom&&(n=!0),this._transition&&(this._transition.stop(),this._transition=null);var r=function(e){t._set(e,function(){i&&i(),t._mediator.emit(f.d.EVENTS.ZOOM_DONE,t._zoom)}),t._transition=null,t._sdk.setTextureQuality(Math.min(t._zoom,1))};if(n)return r(e);this._transition=new p.a({zoom:this._zoom},{zoom:e},{duration:300,easing:"easeOutQuart",onUpdate:function(e){t._set(e.zoom)},onDone:function(e){r(e.zoom)}}),this._transition.start()}},{key:"tick",value:function(){this._transition&&this._transition.update()}},{key:"_getClosestZoomLevel",value:function(e,t){var n=void 0;return-1===t?(n=this._zoomLevels.filter(function(t){return t<e}).pop())||(n=this._zoomLevels[this._zoomLevels.length-1]):1===t&&((n=this._zoomLevels.filter(function(t){return t>e})[0])||(n=this._zoomLevels[0])),n}},{key:"undo",value:function(){this._previousZoom&&(this.set(this._previousZoom),this._previousZoom=null)}},{key:"_set",value:function(e,t){this._zoom=e,this._sdk.setZoom(this._zoom),this._mediator.emit(f.d.EVENTS.ZOOM_CHANGED,this._zoom),this.emit("set",this._zoom,t)}},{key:"_calculateDefaultZoomLevel",value:function(){var e=this._editor.getFinalDimensions(!1),t=this._editor.getCanvasDimensions();return f.r.resizeVectorToFit(e,t).divide(e).x}},{key:"getSnapshot",value:function(){return{zoom:this._targetZoom}}},{key:"restoreSnapshot",value:function(e){this.set(e.zoom,!0)}},{key:"minimum",get:function(){var e=this._editor.getFinalDimensions();return f.r.resizeVectorToFit(e,new f.w(300,300)).divide(e).x}},{key:"level",get:function(){return this._zoom}},{key:"defaultLevel",get:function(){return this._defaultLevel}},{key:"targetLevel",get:function(){return this._targetZoom}}]),t}();t.a=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(7),a=(n.n(o),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),s={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},l=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._obj=t,this._initialObj=o.Utils.clone(t),this._targetValues=n,this._options=o.Utils.defaults(i,{duration:1e3,easing:"easeOutQuad",onUpdate:function(){},onDone:function(){}}),this._startedAt=null,this._running=!1}return a(e,[{key:"start",value:function(){this._startedAt=+new Date,this._running=!0}},{key:"update",value:function(){if(this._running){var e=+new Date-this._startedAt,t=s[this._options.easing],n=Math.min(1,e/this._options.duration),i=t(n);for(var r in this._initialObj){var o=this._initialObj[r],a=this._targetValues[r];this._obj[r]=o+(a-o)*i}this._options.onUpdate(this._obj),n>=1&&(this._options.onDone(this._obj),this.stop())}}},{key:"stop",value:function(){this._running=!1}}]),e}();t.a=l},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return o()(e)}var r=n(20),o=n.n(r),a=n(0),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(7),_=(n.n(h),n(4)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||d()(t)).call(this));return r._editor=e,r._sdk=n,r._mediator=i,r._undoItems=[],r._redoItems=[],r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}(t,_.e),m(t,[{key:"hasInitialState",value:function(){return h.Utils.Array.flatten(this.getUndoItems()).length>0}},{key:"isUndoAvailable",value:function(){return h.Utils.Array.flatten(this.getUndoItems()).length>1}},{key:"isRedoAvailable",value:function(){return h.Utils.Array.flatten(this.getRedoItems()).length>0}},{key:"addSnapshot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o={snapshot:this._editor.getSnapshot(),scope:e,identifier:n,controls:i,data:r},a=h.Utils.Array.last(this._undoItems);a&&t&&o.identifier===a.identifier&&this._undoItems.pop(),this._undoItems.push(o),this._mediator.emit(_.d.EVENTS.HISTORY_UPDATED,o.operation),this._redoItems=[]}},{key:"undo",value:function(){var e=this._undoItems,t=e.pop(),n=h.Utils.Array.last(e);n&&t&&(this._editor.restoreSnapshot(n.snapshot),this._mediator.emit(_.d.EVENTS.HISTORY_UNDO,n,t),this._redoItems.push(t),this.emit("undo"))}},{key:"redo",value:function(){var e=this._redoItems.pop();e&&(this._mediator.emit(_.d.EVENTS.HISTORY_BEFORE_REDO,e),this._editor.restoreSnapshot(e.snapshot),this._mediator.emit(_.d.EVENTS.HISTORY_REDO,e),this._undoItems.push(e),this.emit("redo"))}},{key:"remove",value:function(e){var t=e.scope,n=e.identifier,i=e.controls,r=function(e,r,o){return!(t&&t!==e.scope||n&&n!==e.identifier||i&&i!==e.controls)};this._undoItems=h.Utils.Array.remove(this._undoItems,r),this._redoItems=h.Utils.Array.remove(this._redoItems,r)}},{key:"removeLocal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.remove({scope:"local",identifier:e,controls:t})}},{key:"removeGlobal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.remove({scope:"global",identifier:e,controls:t})}},{key:"removeControls",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.remove({scope:t,controls:e,identifier:n})}},{key:"reset",value:function(){this._undoItems=[],this._redoItems=[]}},{key:"getUndoItems",value:function(){return[].concat(i(this._undoItems))}},{key:"getItems",value:function(){return this.getUndoItems()}},{key:"getRedoItems",value:function(){return[].concat(i(this._redoItems))}}]),t}();t.a=g},function(e,t,n){e.exports={default:n(251),__esModule:!0}},function(e,t,n){n(252),e.exports=n(10).Object.freeze},function(e,t,n){var i=n(17),r=n(108).onFreeze;n(48)("freeze",function(e){return function(t){return e&&i(t)?e(r(t)):t}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(115),a=n(116),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="1.0.0"},function(e,t,n){var i=function(){return this}()||Function("return this")(),r=i.regeneratorRuntime&&Object.getOwnPropertyNames(i).indexOf("regeneratorRuntime")>=0,o=r&&i.regeneratorRuntime;if(i.regeneratorRuntime=void 0,e.exports=n(255),r)i.regeneratorRuntime=o;else try{delete i.regeneratorRuntime}catch(e){i.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,o){var a=t&&t.prototype instanceof r?t:r,s=Object.create(a.prototype),l=new p(o||[]);return s._invoke=function(e,t,n){var r=C;return function(o,a){if(r===x)throw new Error("Generator is already running");if(r===T){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=c(s,n);if(l){if(l===O)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===C)throw r=T,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=x;var u=i(e,t,n);if("normal"===u.type){if(r=n.done?T:E,u.arg===O)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=T,n.method="throw",n.arg=u.arg)}}}(e,n,l),s}function i(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function r(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){var t;this._invoke=function(n,r){function o(){return new Promise(function(t,o){!function t(n,r,o,a){var s=i(e[n],e,r);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"==typeof c&&g.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(c).then(function(e){l.value=e,o(l)},a)}a(s.arg)}(n,r,t,o)})}return t=t?t.then(o,o):o()}}function c(e,t){var n=e.iterator[t.method];if(n===_){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=_,c(e,t),"throw"===t.method))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var r=i(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,O;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=_),t.delegate=null,O):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O)}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function p(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset(!0)}function d(e){if(e){var t=e[v];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(g.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=_,t.done=!0,t};return i.next=i}}return{next:h}}function h(){return{value:_,done:!0}}var _,m=Object.prototype,g=m.hasOwnProperty,y="function"==typeof Symbol?Symbol:{},v=y.iterator||"@@iterator",b=y.asyncIterator||"@@asyncIterator",k=y.toStringTag||"@@toStringTag",w="object"==typeof e,S=t.regeneratorRuntime;if(S)w&&(e.exports=S);else{(S=t.regeneratorRuntime=w?e.exports:{}).wrap=n;var C="suspendedStart",E="suspendedYield",x="executing",T="completed",O={},R={};R[v]=function(){return this};var D=Object.getPrototypeOf,I=D&&D(D(d([])));I&&I!==m&&g.call(I,v)&&(R=I);var P=a.prototype=r.prototype=Object.create(R);o.prototype=P.constructor=a,a.constructor=o,a[k]=o.displayName="GeneratorFunction",S.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},S.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,k in e||(e[k]="GeneratorFunction")),e.prototype=Object.create(P),e},S.awrap=function(e){return{__await:e}},s(l.prototype),l.prototype[b]=function(){return this},S.AsyncIterator=l,S.async=function(e,t,i,r){var o=new l(n(e,t,i,r));return S.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},s(P),P[k]="Generator",P[v]=function(){return this},P.toString=function(){return"[object Generator]"},S.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},S.values=d,p.prototype={constructor:p,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=_,this.done=!1,this.delegate=null,this.method="next",this.arg=_,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=_)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,i){return o.type="throw",o.arg=e,n.next=t,i&&(n.method="next",n.arg=_),!!i}if(this.done)throw e;for(var n=this,i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],o=r.completion;if("root"===r.tryLoc)return t("end");if(r.tryLoc<=this.prev){var a=g.call(r,"catchLoc"),s=g.call(r,"finallyLoc");if(a&&s){if(this.prev<r.catchLoc)return t(r.catchLoc,!0);if(this.prev<r.finallyLoc)return t(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return t(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return t(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&g.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,O):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;f(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=_),O}}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(7);n.n(c);var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.Configurable),t}();t.a=u,u.prototype.availableOptions={fontFamily:{type:c.OptionType.STRING,required:!0},variations:{type:c.OptionType.ARRAY,required:!0}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(121),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_={italic:"i"},m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.a),h(t,[{key:"load",value:function(){return this._fonts.length&&this._addStylesheetTag(),function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"load",this).call(this)}},{key:"_addStylesheetTag",value:function(){var e=this._getFamiliesString(),t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css?family="+e,document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_getFamiliesString",value:function(){var e={};this._fonts.forEach(function(t){var n=t.getFontFamily(),i=t.getFontStyle(),r=t.getFontWeight();e[n]=e[n]||[],void 0!==r?e[n].push(""+r+(_[i]||"")):e[n].push(400)});var t=[];for(var n in e){var i=e[n],r=i.length?":"+i.join(","):"",o=n.replace(" ","+")+r;t.push(o)}return t.join("|")}}]),t}();t.a=m},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(259),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c="undefined"!=typeof window&&window.performance&&window.performance.now?window.performance.now.bind(window.performance):n(111),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._fontVariation=t,this._defaultFontRuler=new s.a,this._customFontRuler=new s.a(this._fontVariation)}return l(e,[{key:"observe",value:function(){var e=this,t=c();return new a.a(function(n,i){var r=window.setInterval(function(){if(e._defaultFontRuler.getWidth()!==e._customFontRuler.getWidth())return window.clearInterval(r),n();if(c()-t>=5e3){var o=new Error("Failed to load font "+e._fontVariation.getFontFamily()+".");return o.font=e._fontVariation,i(o)}},50)})}},{key:"dispose",value:function(){this._defaultFontRuler.dispose(),this._customFontRuler.dispose()}}]),e}();t.a=u},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(120),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._fontVariation=t||new o.a({fontFamily:"Times New Roman",fontWeight:"normal",fontStyle:"normal"}),this._createRuler()}return a(e,[{key:"_createRuler",value:function(){this._ruler=document.createElement("div"),this._ruler.innerText="abcdefghijklmnopqrstuvwxzy",document.body.appendChild(this._ruler),this._setRulerStyle()}},{key:"_setRulerStyle",value:function(){this._ruler.style.cssText="\n      position: absolute;\n      top: -9999px;\n      left: -9999px;\n      opacity: 0;\n      display: inline-block;\n      font: "+this._fontVariation.getFontStyle()+" "+this._fontVariation.getFontWeight()+" 30px "+this._fontVariation.getFontFamily()+";\n    "}},{key:"setFontVariation",value:function(e){this._fontVariation=e,this._setRulerStyle()}},{key:"getWidth",value:function(){return this._ruler?this._ruler.offsetWidth:-1}},{key:"dispose",value:function(){this._ruler&&(this._ruler.parentNode.removeChild(this._ruler),this._ruler=null)}}]),e}();t.a=s},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(121),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"load",value:function(){var e=this,n=[];return this._fonts.forEach(function(t){var i=e._ui.getAssetPath(t.getFilePath(),!1,!0);n.push('@font-face {\n        font-family: "'+t.getFontFamily()+"\";\n        src: url('"+i+"') format('woff');\n        font-weight: "+t.getFontWeight()+";\n        font-style: "+t.getFontStyle()+";\n      }")}),d.x.global(n.join("\n"),!0),function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"load",this).call(this)}}]),t}();t.a=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(122),a=n(123),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="1.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(82),a=n(83),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="2.0.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(264),a=n(265),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="2.0.1"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(82),u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.a),t}();t.a=u,u.version="2.0.0"},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(83),u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.a),t}();t.a=u,u.version="2.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(127),a=n(129),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.0.0"},function(e,t,n){e.exports={default:n(268),__esModule:!0}},function(e,t,n){n(269),e.exports=n(10).Object.values},function(e,t,n){var i=n(11),r=n(270)(!1);i(i.S,"Object",{values:function(e){return r(e)}})},function(e,t,n){var i=n(29),r=n(19),o=n(35).f;e.exports=function(e){return function(t){for(var n,a=r(t),s=i(a),l=s.length,c=0,u=[];l>c;)o.call(a,n=s[c++])&&u.push(e?[n,a[n]]:a[n]);return u}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(130),a=n(131),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.1.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(132),a=n(133),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.2.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(134),a=n(135),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.4.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(137),a=n(138),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.5.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(139),a=n(140),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.6.0"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n.n(i),o=n(277),a=n(278),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t}return s(e,[{key:"serialize",value:function(){var e=new o.a(this._editor);return e.serialize.apply(e,arguments)}},{key:"deserialize",value:function(e){return new a.a(this._editor,e).deserialize()}}]),e}();t.default=l,l.version="3.7.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(139),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.a),m(t,[{key:"serialize",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"serialize",this).call(this,n).then(function(t){return e._serializeAssetLibrary(t).then(function(e){return e})})}},{key:"_serializeAssetLibrary",value:function(e){if(!this._editor.getDynamicAssetsLibrary)return p.a.resolve(e);var t=this._editor.getDynamicAssetsLibrary(),n=this._serializeCustomStickerAssets(e,t);return 0===n.length?p.a.resolve(e):(e.assetLibrary={assets:{stickers:n}},p.a.resolve(e))}},{key:"_serializeCustomStickerAssets",value:function(e,t){var n=t.getAssets("sticker");if(0===n.length)return[];var i={};return e.operations.filter(function(e){return"sprite"===e.type}).flatMap(function(e){return e.options.sprites}).filter(function(e){return"sticker"===e.type}).map(function(e){return e.options.identifier}).forEach(function(e){i[e]=!0}),n.filter(function(e){return i[e.identifier]}).map(function(e){var t=e.identifier,n=e.defaultName,i=e.images,r=i.mediaBase.uris[0],o=i.mediaBase.isSVG,a=/^data:(image\/(jpeg|png));base64,(.*)$/g.exec(r),s={identifier:t,name:n,raster:{type:a[1],data:a[3]}};return n&&(s.name=n),o&&(s.svg={data:i.mediaBase.uris[1].replace(/^data:image\/svg\+xml;base64,/g,"")}),s})}}]),t}();t.a=g,g.version="3.7.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(140)),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"deserialize",value:function(){var e=this;return this._validateVersion().then(function(){return e._deserializeAssetLibrary()}).then(function(){return e._deserializeInputImage()}).then(function(){return e._deserializeOperations()})}},{key:"_deserializeAssetLibrary",value:function(){var e=this;return new u.a(function(t,n){var i=e._data;if(i.assetLibrary){var r=i.assetLibrary.assets,o=[];for(var a in r)o.push(e._deserializeCustomAssets(a,r[a]));return u.a.all(o).then(function(){t()}).catch(function(e){console.error(e),n(e)})}t()})}},{key:"_deserializeCustomAssets",value:function(e,t){switch(e){case"stickers":return this._deserializeCustomStickerAssets(t);default:return u.a.reject(new Error("Unknown asset type: "+e))}}},{key:"_deserializeCustomStickerAssets",value:function(e){var t=this,n="none",i=this._editor.getOptions().controlsOptions;i&&i.controlsOptions&&i.controlsOptions.sticker&&(n=i.controlsOptions.sticker.customStickerTintMode||"none");var r=e.map(function(e){return new u.a(function(i,r){var o=e.identifier,a=e.raster,s=void 0!==e.svg,l="data:"+a.type+";base64,"+a.data,c=new d.Image;c.onload=function(){var r={data:"",width:1,height:1};r=t._stickerManager.renderStickerThumbnailFromImage(c);var a={identifier:o,defaultName:e.name||"",tintMode:n,images:{mediaBase:{uris:[l],rawData:!0,isSVG:s,width:c.width,height:c.height},mediaThumb:{uris:[r.data],rawData:!0,width:r.width,height:r.height}}};if(s){var u="data:image/svg+xml;base64,"+e.svg.data;a.images.mediaBase.uris.push(u)}i(a)},c.onerror=function(){r(new Error("Invalid base64 data: "+l))},c.src=l})});return u.a.all(r).then(function(e){t._editor.getDynamicAssetsLibrary().setAssets("sticker",e),t._stickerManager.reload()})}}]),t}();t.a=m,m.version="3.7.0"},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(280),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._needsStyleFixes=!0,o._bindAll("_onMouseEnter","_onMouseLeave"),o.state={isHovering:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),d(t,[{key:"shouldComponentUpdate",value:function(e,t){return e.currentControl!==this.props.currentControl||t.isHovering!==this.state.isHovering}},{key:"_onItemClick",value:function(e){this.props.disabled||(this._onMouseLeave(),this.props.onControlSwitch(e))}},{key:"_onMouseEnter",value:function(){this.props.disabled||this.setState({isHovering:!0})}},{key:"_onMouseLeave",value:function(){this.props.disabled||this.setState({isHovering:!1})}},{key:"fixStyles",value:function(){if(f.v.Browser.isIElte(10)){var e=this._navigation.offsetHeight;this._gradient.style.height=e+"px"}}},{key:"_getItemCount",value:function(e){var t=this;return e.reduce(function(e,n){return Array.isArray(n)?e+t._getItemCount(n):e+1},0)}},{key:"_renderListItems",value:function(){var e=this,t=this.context.editor,n=this.state.isHovering,i=function(i,r,o){var a=t.controls.get(i),s=i===e.props.currentControl;return f.m.createElement(p.a,{key:i,title:i,showTitle:n,iconPath:e._getAssetPath(a.iconPath,!0),activeIconPath:e._getAssetPath(a.activeIconPath,!0),selected:s,onClick:e._onItemClick.bind(e,i),animationDelay:.02*r,maxAnimationDelay:.02*o,disabled:e.props.disabled})},r=[],o=this.context.options.editor.controlsOrder,a=this._getItemCount(o)-1;return o.forEach(function(e,n){if(Array.isArray(e))e.forEach(function(e){t.controls.isEnabled(e)&&r.push(i(e,r.length,a))}),n!==o.length-1&&r.length&&r.push(function(e){return f.m.createElement(p.a,{key:e,isSeparator:!0})}("separator-"+n));else{if(!t.controls.isEnabled(e))return;r.push(i(e,r.length,a))}}),r}},{key:"render",value:function(){var e=this,t=this.state.isHovering,n={backgroundImage:"url("+this._getAssetPath("editor/navigation/nav-gradient.png",!0)+")"};return f.m.createElement(_,{onMouseLeave:this._onMouseLeave,innerRef:function(t){e._navigation=t}},f.m.createElement(m,{onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave,disabled:this.props.disabled},this._renderListItems()),f.m.createElement(g,{className:void 0,innerRef:function(t){e._gradient=t},style:n,visible:t}))}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h;var _=f.x.div("61cdxs","NavigationContainer"),m=f.x.ul("9phbku","Navigation"),g=f.x.div("5jr86g",{visible:"1aw31yo"},"NavigationOverlay")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"shouldComponentUpdate",value:function(e,t){return e.showTitle!==this.props.showTitle||e.selected!==this.props.selected}},{key:"render",value:function(){if(this.props.isSeparator)return f.m.createElement(m,null);var e={transitionDelay:(this.props.showTitle?this.props.animationDelay:this.props.maxAnimationDelay-this.props.animationDelay)+"s"};return f.m.createElement(_,{onClick:this.props.onClick,selected:this.props.selected,className:void 0,"data-identifier":this.props.title,disabled:this.props.disabled},f.m.createElement(y,{src:this.props.iconPath,selected:this.props.selected}),f.m.createElement(v,{src:this.props.activeIconPath,selected:this.props.selected}),f.m.createElement(b,{style:e,withTitle:this.props.showTitle},f.m.createElement(k,null,this._t("pesdk."+this.props.title+".title.name"))))}}]),t}();d.contextTypes=f.b.contextTypes,t.a=d;var h=f.x.li("175e5wy","BaseItem"),_=Object(f.x)(h)("djzsp",{selected:"b4k2au",disabled:"kcb0uq"},"NavigationItem"),m=Object(f.x)(h)("w5rgvu","SeparatorItem"),g=f.x.img("1ew58rj","Icon"),y=Object(f.x)(g)("vd96gg",{selected:"1cfz9kz"},"InactiveIcon"),v=Object(f.x)(g)("8p00lh",{selected:"zgbg08"},"ActiveIcon"),b=f.x.div("124navh",{withTitle:"1j7o6on"},"TitleContainer"),k=f.x.div("pw4had","Title")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return a._bindAll("_onEditorResize"),a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},d.d.EVENTS.EDITOR_RESIZE,a._onEditorResize),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),h(t,[{key:"_onEditorResize",value:function(e){var t=this.context.editor;t.getSDK().resizeTo(e),t.zoom.auto(!0,!0)}},{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this);var e=this.context,n=e.editor,i=e.options,r=this._canvas.offsetWidth,o=this._canvas.offsetHeight,s=n.getSDK().getRenderer();s.setCanvas(this._canvas),s.resizeTo(new d.w(r,o));var l=i.editor.image;n.setPadding([55,30,55,315]),n.setImage(l,!1)}},{key:"render",value:function(){var e=this;return d.m.createElement(m,{innerRef:function(t){e._canvas=t}})}}]),t}();_.contextTypes=d.b.contextTypes,t.a=_;var m=d.x.canvas("8gacw5","Canvas")},function(e,t,n){"use strict";var i=n(2),r=n.n(i),o=n(3),a=n.n(o),s=n(1),l=n.n(s),c=n(7);n.n(c);var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||l()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=a()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.a?r()(e,t):e.__proto__=t)}(t,c.Configurable),t}();t.a=u,u.prototype.availableOptions={identifier:{type:c.OptionType.STRING,required:!0},defaultName:{type:c.OptionType.STRING,required:!0},ratios:{type:c.OptionType.ARRAY,required:!0,default:[]}}},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(2),s=n.n(a),l=n(3),c=n.n(l),u=n(1),f=n.n(u),p=n(8),d=n.n(p),h=n(4),_=n(44),m=n(284),g=n(285),y=n(286),v=(n(144),n(287)),b=(n.n(v),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),k=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(o)));return s._bindAll("_onUndoClick","_onExportClick","_onSaveClick","_onLoadClick","_onCloseClick","_onHistoryUpdated","_onFeaturesUpdated","_onRedoClick"),s._events=(i(n={},h.d.EVENTS.HISTORY_UPDATED,s._onHistoryUpdated),i(n,h.d.EVENTS.FEATURES_UPDATED,s._onFeaturesUpdated),n),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=c()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.a?s()(e,t):e.__proto__=t)}(t,h.b),b(t,[{key:"_onHistoryUpdated",value:function(){this.forceUpdate()}},{key:"_onFeaturesUpdated",value:function(){this.forceUpdate()}},{key:"_onUndoClick",value:function(){this.context.editor.history.undo(),this.forceUpdate()}},{key:"_onRedoClick",value:function(){this.context.editor.history.redo(),this.forceUpdate()}},{key:"_onCloseClick",value:function(){this.context.mediator.emit(h.d.EVENTS.CLOSE)}},{key:"_onExportClick",value:function(){var e=this,t=this.context,n=t.options,i=t.editor,r=t.screen,o=n.editor.export,a=new d.a(function(t){return setTimeout(function(){t()},1e3*e.context.theme.transitionDuration)}),s=_.a.instance.displayLoading(this._t("pesdk.editor.text.exporting"));r.state.controls.onBeforeExport().then(function(){return a}).then(function(){return i.export(o.download).then(function(){return s.close(),r.state.controls.onAfterExport()})}).catch(function(t){return _.a.instance.displayError(e._t("errors.title"),t.message),s.close(),r.state.controls.onAfterExport()})}},{key:"_onSaveClick",value:function(){var e=this,t=this.context,n=t.options,i=t.editor,r=t.screen,o=n.editor.save,a=_.a.instance.displayLoading(this._t("pesdk.editor.text.saving"));r.state.controls.onBeforeExport().then(function(){return i.save(o.download).then(function(){return a.close(),r.state.controls.onAfterExport()}).catch(function(t){return _.a.instance.displayError(e._t("errors.title"),t.message),a.close(),r.state.controls.onAfterExport()})})}},{key:"_onLoadClick",value:function(){var e=this,t=this.context,n=t.editor,i=t.screen;this._loadFileInput&&function(e){return new d.a(function(t,n){e?(e.addEventListener("error",function(e){n(e)}),e.addEventListener("abort",function(){t()}),e.addEventListener("change",function(e){var n=e.target.files;n.length||t(null);var i=n[0];t(i)}),e.value=null,e.click()):n(new Error("Input field not valid!"))})}(this._loadFileInput).then(function(t){var r=_.a.instance.displayLoading(e._t("pesdk.editor.text.loading"));i.state.controls.onBeforeExport().then(function(){return function(e){return new d.a(function(t,n){var i=new window.FileReader;i.onerror=function(e){n(e)},i.onload=function(e){t(e.target.result)},i.readAsText(e)})}(t).then(function(t){return t&&n.load(t).then(function(){return r.close(),i.state.controls.onAfterExport()}).catch(function(t){return _.a.instance.displayError(e._t("errors.title"),t.message),r.close(),i.state.controls.onAfterExport()})})})})}},{key:"_renderItems",value:function(){var e=this,t=this.context.editor,n=t.history,i=t.features,r=t.getOptions().editor.displayCloseButton,o=h.m.createElement(g.a,{disabled:!n.isUndoAvailable(),src:this._getAssetPath("editor/canvas-header/undo.png",!0),onClick:this._onUndoClick,className:void 0}),a=h.m.createElement(g.a,{disabled:!n.isRedoAvailable(),src:this._getAssetPath("editor/canvas-header/redo.png",!0),onClick:this._onRedoClick,className:void 0});return[h.m.createElement(C,{key:"left",left:!0},o,a),h.m.createElement(S,{key:"center"},i.isEnabledByOptions("zoom")&&h.m.createElement(y.a,null)),h.m.createElement(C,{key:"right",right:!0},i.isEnabled("load")&&h.m.createElement(E,{type:"file",accept:"text/json",innerRef:function(t){e._loadFileInput=t}}),i.isEnabled("load")&&h.m.createElement(m.a,{title:this._t("pesdk.editor.button.load"),onClick:this._onLoadClick,className:void 0}),i.isEnabled("save")&&h.m.createElement(m.a,{title:this._t("pesdk.editor.button.save"),onClick:this._onSaveClick,className:void 0}),i.isEnabled("export")&&h.m.createElement(m.a,{title:this._t("pesdk.editor.button.export"),onClick:this._onExportClick,className:void 0}),r&&h.m.createElement(m.a,{title:this._t("pesdk.editor.button.close"),onClick:this._onCloseClick,className:void 0}))]}},{key:"render",value:function(){return h.m.createElement(w,{className:this.props.className},this._renderItems())}}]),t}();k.contextTypes=h.b.contextTypes,t.a=k;var w=h.x.div("1vo3slj","CanvasHeaderControls"),S=h.x.div("h5xlzy","CenteredControlGroup"),C=h.x.ul("17ty59f",{left:"1elyhsq",right:"1l7kz3k"},"ControlGroup"),E=h.x.input("19u9mq5","HiddenFileInput")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(143),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.a),d(t,[{key:"render",value:function(){return f.m.createElement(p.a,{onClick:this.props.onClick,className:this.props.className},f.m.createElement(_,{disabled:this.props.disabled},this.props.title))}}]),t}();h.contextTypes=p.a.contextTypes,t.a=h;var _=f.x.div("1d3mv64",{disabled:"1wcaxw7"},"Button");h.Button=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(143),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.a),d(t,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.className,i=e.disabled;return f.m.createElement(p.a,{disabled:i,onClick:i?void 0:t,className:n},f.m.createElement(_,{disabled:i,src:this.props.src}))}}]),t}();h.contextTypes=p.a.contextTypes,t.a=h;var _=f.x.img("1y2itdu",{disabled:"vxlu5c"},"Image")},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(6),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(4),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||d()(t)).call.apply(e,[this].concat(o)));return s._bindAll("_onZoomInClick","_onZoomOutClick","_onZoom","_onFeaturesUpdated"),s._events=(i(n={},h.d.EVENTS.ZOOM,s._onZoom),i(n,h.d.EVENTS.FEATURES_UPDATED,s._onFeaturesUpdated),n),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}(t,h.b),_(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=s()(t,n);if(void 0===r){var o=d()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||d()(t.prototype),"componentDidMount",this).call(this),this._renderZoomLevel&&this._renderZoomLevel!==this.context.editor.zoom.targetLevel&&this.forceUpdate()}},{key:"_onFeaturesUpdated",value:function(){this.forceUpdate()}},{key:"_onZoom",value:function(){this.forceUpdate()}},{key:"_onZoomInClick",value:function(){this._isZoomDisabled()||this.context.editor.zoom.in()}},{key:"_onZoomOutClick",value:function(){this._isZoomDisabled()||this.context.editor.zoom.out()}},{key:"_isZoomDisabled",value:function(){return!this.context.editor.features.isEnabled("zoom")}},{key:"render",value:function(){var e=this.context.editor,t=Math.round(100*e.zoom.targetLevel);return this._renderZoomLevel=e.zoom.targetLevel,h.m.createElement(g,{className:void 0},h.m.createElement(y,{disabled:this._isZoomDisabled(),"data-disabled":this._isZoomDisabled(),onClick:this._onZoomOutClick,className:void 0},"-"),h.m.createElement(v,null,t," %"),h.m.createElement(y,{disabled:this._isZoomDisabled(),"data-disabled":this._isZoomDisabled(),onClick:this._onZoomInClick,className:void 0},"+"))}}]),t}();m.contextTypes=h.b.contextTypes,t.a=m;var g=h.x.div("12hdgpj","ZoomControl"),y=h.x.div("eqhwwg",{disabled:"10fa721"},"Button"),v=h.x.div("64aub5","Label")},function(e,t){},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll(),o._canHideAfterLoaded=!1,o.state={startImageVisible:!0,idleImageVisible:!1,indicatorVisible:!0},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),h(t,[{key:"componentDidMount",value:function(){var e=this;_(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._imageSwitchTimeout=window.setTimeout(function(){e.setState({startImageVisible:!1,idleImageVisible:!0}),e._imageSwitchTimeout=null},1300)}},{key:"componentWillUnmount",value:function(){_(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),this._imageSwitchTimeout&&(window.clearTimeout(this._imageSwitchTimeout),this._imageSwitchTimeout=null)}},{key:"getChildContext",value:function(){return{ui:this.context.ui,options:this.context.options,mediator:this.context.mediator,appComponent:this.context.appComponent}}},{key:"render",value:function(){var e=this,t=this.state,n=t.startImageVisible,i=t.idleImageVisible,r=t.indicatorVisible;return d.m.createElement(g,{innerRef:function(t){e._container=t},className:void 0},d.m.createElement(y,{hidden:!r},d.m.createElement(b,{visible:n,src:this._getAssetPath("loading/start-solid.gif",!0)}),d.m.createElement(k,{visible:i,src:this._getAssetPath("loading/idle-solid.gif",!0)})))}}]),t}();m.contextTypes=d.b.contextTypes,m.childContextTypes={ui:d.k.object.isRequired,mediator:d.k.object.isRequired,options:d.k.object.isRequired,appComponent:d.k.object.isRequired};var g=d.x.div("121fa7f","Container"),y=d.x.div("110xr2i",{hidden:"qbdcep"},"ImageContainer"),v=d.x.img("1gqfg7n",{visible:"zgbg08"},"Image"),b=Object(d.x)(v)("120drhm","StartImage"),k=Object(d.x)(v)("120drhm","IdleImage");t.a=Object(d.B)(m)},function(e,t,n){"use strict";t.a=function(e,t){e.global(t+" html,"+t+" body,"+t+" div,"+t+" span,"+t+" applet,"+t+" object,"+t+" iframe,"+t+" h1,"+t+" h2,"+t+" h3,"+t+" h4,"+t+" h5,"+t+" h6,"+t+" p,"+t+" blockquote,"+t+" pre,"+t+" a,"+t+" abbr,"+t+" acronym,"+t+" address,"+t+" big,"+t+" cite,"+t+" code,"+t+" del,"+t+" dfn,"+t+" em,"+t+" img,"+t+" ins,"+t+" kbd,"+t+" q,"+t+" s,"+t+" samp,"+t+" small,"+t+" strike,"+t+" strong,"+t+" sub,"+t+" sup,"+t+" tt,"+t+" var,"+t+" b,"+t+" u,"+t+" i,"+t+" center,"+t+" dl,"+t+" dt,"+t+" dd,"+t+" ol,"+t+" ul,"+t+" li,"+t+" fieldset,"+t+" form,"+t+" label,"+t+" legend,"+t+" table,"+t+" caption,"+t+" tbody,"+t+" tfoot,"+t+" thead,"+t+" tr,"+t+" th,"+t+" td,"+t+" article,"+t+" aside,"+t+" canvas,"+t+" details,"+t+" embed,"+t+" figure,"+t+" figcaption,"+t+" footer,"+t+" header,"+t+" hgroup,"+t+" menu,"+t+" nav,"+t+" output,"+t+" ruby,"+t+" section,"+t+" summary,"+t+" time,"+t+" mark,"+t+" audio,"+t+" video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}"+t+" html{line-height:1}"+t+" ol,"+t+" ul{list-style:none}"+t+" table{border-collapse:collapse;border-spacing:0}"+t+" caption,"+t+" th,"+t+" td{text-align:left;font-weight:400;vertical-align:middle}"+t+" q,"+t+" blockquote{quotes:none}"+t+" q:before,"+t+" q:after,"+t+" blockquote:before,"+t+' blockquote:after{content:"";content:none}'+t+" a img{border:none}"+t+" article,"+t+" aside,"+t+" details,"+t+" figcaption,"+t+" figure,"+t+" footer,"+t+" header,"+t+" hgroup,"+t+" main,"+t+" menu,"+t+" nav,"+t+" section,"+t+" summary{display:block}@media only screen and (min-width: 768px){"+t+"{-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}}"+t+","+t+" *{box-sizing:border-box}")}},function(e,t,n){"use strict";t.a=function(e,t){e.global("\n    @-webkit-keyframes bouncingLoadingIndicator {\n      0% {\n        transform: translateY(0);\n      }\n      40% {\n        transform: translateY(10px);\n      }\n      60% {\n        transform: translateY(-5px);\n      }\n      80%{\n        transform: translateY(0);\n      }\n    }\n  ")}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(112),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).call(this));return r._ui=e,r._options=n,r._mediator=i,r._assets={},r._editor=new p.a(e,n,i,!0),r._assets=["editor/canvas-header/undo.png","editor/navigation/nav-gradient.png","editor/controls/shared/checkbox.png","editor/controls/shared/checkbox-active.png","editor/controls/shared/tiled-background.png"],r._appendControlsAssets(),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.e),d(t,[{key:"_appendControlsAssets",value:function(){var e=this._editor.controls.getAvailable();for(var t in e){var n=e[t];this._editor.controls.isEnabled(t)&&(this._assets=this._assets.concat(n.getPreloadAssets(this._editor)),this._assets.push(n.iconPath),this._assets.push(n.activeIconPath))}}},{key:"load",value:function(){var e=this,t=this._assets.slice(),n=t.length,i=0,r=function(){i++,e.emit("progress",i/n),i===n&&e.emit("done")},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"timed out";f.h.warn("Preloader",e+" "+t+"."),r()};t.forEach(function(t){var n=!0;Array.isArray(t)&&(n=t[1],t=t[0]);var i=!0;f.r.isArray(t)&&(i=t[1],t=t[0]);var a=e._ui.getAssetPath(t,n,!i),s=new window.Image,l=function(e){return window.setTimeout(function(){o(e)},5e3)}(a);s.addEventListener("load",function(){window.clearTimeout(l),e._assets[t]=s,r()}),s.addEventListener("error",function(){window.clearTimeout(l),o(a,"was not found")}),s.crossOrigin=f.r.getCrossOriginValue(e._options.crossOrigin),s.src=a})}},{key:"getAsset",value:function(e){return this._assets[e]}}]),t}();t.a=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(293),r=n(44),o=n(297),a=n(146),s=n(298),l=n(126),c=n(26),u=n(54),f=n(119),p=n(118),d=n(124),h=n(125),_=n(141),m=n(33),g=n(136),y=n(299),v=n(300),b=n(301),k=n(56),w=n(142),S=n(303),C=n(304),E=n(305),x=n(84),T=n(87),O=n(309),R=n(315),D=n(316),I=n(317),P=n(21),A=n(318),M=n(319),F=n(320),j=n(53),B=n(147);n.d(t,"Frame",function(){return l.a}),n.d(t,"SharedStateComponent",function(){return k.a}),n.d(t,"ControlsComponent",function(){return w.a}),n.d(t,"CollapseSectionComponent",function(){return S.a}),n.d(t,"ScrollableListComponent",function(){return C.a}),n.d(t,"SliderControlComponent",function(){return E.a}),n.d(t,"CanvasControlsComponent",function(){return x.a}),n.d(t,"ValueSelectionComponent",function(){return T.a}),n.d(t,"ColorSelectionComponent",function(){return O.a}),n.d(t,"ButtonComponent",function(){return R.a}),n.d(t,"DropdownComponent",function(){return D.a}),n.d(t,"TextInputComponent",function(){return I.a}),n.d(t,"DraggableComponent",function(){return P.a}),n.d(t,"CanvasDraggableComponent",function(){return A.a}),n.d(t,"InvisibleUploadComponent",function(){return M.a}),n.d(t,"CanvasOverlayControlsComponent",function(){return F.a}),n.d(t,"Transition",function(){return j.a}),n.d(t,"CheckboxComponent",function(){return B.a}),n.d(t,"Library",function(){return i}),n.d(t,"ModalManager",function(){return r.a}),n.d(t,"DelayedJobQueue",function(){return o.a}),n.d(t,"GroupedControlsStyles",function(){return a}),n.d(t,"ControlsStyles",function(){return s}),n.d(t,"FontManager",function(){return c.a}),n.d(t,"StickerManager",function(){return u.a}),n.d(t,"BrushManager",function(){return f.a}),n.d(t,"FilterManager",function(){return p.a}),n.d(t,"FrameManager",function(){return d.a}),n.d(t,"OverlayManager",function(){return h.a}),n.d(t,"TextDesignManager",function(){return m.a}),n.d(t,"TransformRatioManager",function(){return _.a}),n.d(t,"ArtFilterManager",function(){return g.a}),n.d(t,"BaseControls",function(){return y.a}),n.d(t,"LoadingIndicatorComponent",function(){return v.a}),n.d(t,"SuffixedTextInputComponent",function(){return b.a})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(294);n.d(t,"Provider",function(){return i.a});var r=n(295);n.d(t,"Category",function(){return r.a});var o=n(296);n.d(t,"Image",function(){return o.a})},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(8),a=n.n(o),s=n(4),l=n(52),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return c(e,[{key:"_loadJSON",value:function(e){return new l.a(e).load()}},{key:"getCategories",value:function(){return s.h.warn(this.constructor.name,"`getCategories` is abstract and not implemented."),a.a.resolve([])}},{key:"searchImages",value:function(e){return s.h.warn(this.constructor.name,"`searchImages` is abstract and not implemented."),a.a.resolve([])}}]),e}();t.a=u},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._coverImage=null,o._coverImageLoaded=!1,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.q.Configurable),h(t,[{key:"loadCoverImage",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous";return new u.a(function(n,i){var r=new window.Image;r.addEventListener("load",function(){e._coverImageLoaded=!0,n(r)}),r.addEventListener("error",function(){i(new Error("Failed to load image at "+e.getCoverImage()))}),r.crossOrigin=d.r.getCrossOriginValue(t),r.src=e.getCoverImage(),e._coverImage=r})}},{key:"isCoverImageLoaded",value:function(){return this._coverImage&&this._coverImageLoaded}}]),t}();t.a=_,_.prototype.availableOptions={name:{type:d.i.STRING,required:!0},coverImage:{type:d.i.STRING,required:!0}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._thumbImage=null,o._thumbImageLoaded=!1,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.q.Configurable),h(t,[{key:"loadThumb",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous";return new u.a(function(n,i){var r=new window.Image;r.addEventListener("load",function(){e._thumbImageLoaded=!0,n(r)}),r.addEventListener("error",function(){i(new Error("Failed to load image at "+e.getThumbUrl()))}),r.crossOrigin=d.r.getCrossOriginValue(t),r.src=e.getThumbUrl(),e._thumbImage=r})}},{key:"isThumbLoaded",value:function(){return this._thumbImage&&this._thumbImageLoaded}},{key:"getThumbImage",value:function(){return this._thumbImage}}]),t}();t.a=_,_.prototype.availableOptions={category:{type:d.i.OBJECT,required:!0},title:{type:d.i.STRING},rawUrl:{type:d.i.STRING,required:!0},thumbUrl:{type:d.i.STRING},authorName:{type:d.i.STRING},authorAvatar:{type:d.i.STRING}}},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).call(this));return i._jobs=e,i._options=f.r.defaults(n,{minDelay:400}),i._running=!1,i._currentJob=null,i._currentJobIndex=0,i._tick=i._tick.bind(i),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.e),p(t,[{key:"start",value:function(){this._running=!0,this._lastJobFinished=Object(f.z)(),this._tick()}},{key:"_tick",value:function(){var e=this;if(this._running){if(!this._currentJob){if(this._currentJob=this._jobs[this._currentJobIndex],!this._currentJob)return this.emit("done"),void this.stop();this._currentJob.fn().then(function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=function(){e.emit.apply(e,["job-done",e._currentJob].concat(n)),e._lastJobFinished=Object(f.z)(),e._currentJob=null};if(Object(f.z)()-e._lastJobFinished<e._options.minDelay){var o=e._options.minDelay-(Object(f.z)()-e._lastJobFinished);setTimeout(r,o)}else r()}).catch(function(t){e.emit("error",e._currentJob,t),e._currentJob=null}),this._currentJobIndex++}Object(f.A)(this._tick)}}},{key:"stop",value:function(){this._running=!1}},{key:"dispose",value:function(){this._jobs=[],this._running=!1}}]),t}();t.a=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"FullContainer",function(){return r}),n.d(t,"ControlItem",function(){return o}),n.d(t,"ControlItemTextStyles",function(){return a}),n.d(t,"ControlItemTitle",function(){return s}),n.d(t,"ControlItemActiveOverlay",function(){return l}),n.d(t,"ControlItemOverlay",function(){return c}),n.d(t,"Knob",function(){return u}),n.d(t,"PlainControlItem",function(){return f}),n.d(t,"PlainControlItemBackground",function(){return p});var i=n(4),r=i.x.css("vl6nc6","FullContainer"),o=i.x.css("gxhkr8",{animated:"1e40zg6",selected:"10th7ra",visible:"gc4bxi"},"ControlItem"),a=i.x.css("1us1ll5","ControlItemTextStyles"),s=i.x.css("d17ppx",{hovered:"zgbg08"},"ControlItemTitle"),l=i.x.css("x1p1ki",{visible:"zgbg08",rendered:"2jlos"},"ControlItemActiveOverlay"),c=i.x.css("1kza12c","ControlItemOverlay"),u=i.x.css("ywjahx","Knob"),f=i.x.css("9ej9h0",{threeColumns:"14meo64",twoColumns:"4nk392",withText:"rbroui",selected:"eb0k9a"},"PlainControlItem"),p=i.x.css("1lmjuk",{selected:"q4p805"},"PlainControlItemBackground")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(8),l=n.n(s),c=n(4),u=n(7),f=(n.n(u),n(84)),p=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.context=t,this.sharedState=n,this._options=i,this._mediator=t.mediator,this.skipHistory=!1,this._initialOptions={},this._onOperationRemoved=this._onOperationRemoved.bind(this),this._onOperationUpdated=this._onOperationUpdated.bind(this)}return d(e,[{key:"_getAssetPath",value:function(){var e;return(e=this.context.ui).getAssetPath.apply(e,arguments)}},{key:"_t",value:function(e,t){return this.context.ui.translate(e,t)}},{key:"_onOperationRemoved",value:function(e){var t=e.constructor.identifier;this.constructor.updatableOperations.indexOf(t)>=0&&(this.constructor.switchToDefaultControlsOnRemoval?this.skipHistory=!0:(this.onOperationRemoved(e),this.updateSharedState(!0),this.context.editor.render()))}},{key:"onOperationRemoved",value:function(e){}},{key:"_onOperationUpdated",value:function(e,t){var n=e.constructor.identifier;this.constructor.updatableOperations.indexOf(n)>=0&&this.onOperationUpdated(e,t)}},{key:"updateSharedState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.context.editor,n=this.mapOperationsToSharedState(t.operations,e,p({},this.sharedState.getState()));this.sharedState.set(n)}},{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2]}},{key:"onOperationUpdated",value:function(e){var t=this.context.editor;this.updateSharedState(!1),t.render()}},{key:"onEnter",value:function(){var e=this.context.editor.history,t=this.sharedState.get("forceCrop");e.hasInitialState()||t||e.addSnapshot("global"),this._saveOperationsOptions(),this.updateSharedState(!0),this._onEnter(),this.updateSharedState(!1),this._mediator.on(c.d.EVENTS.OPERATION_REMOVED,this._onOperationRemoved),this._mediator.on(c.d.EVENTS.OPERATION_UPDATED,this._onOperationUpdated),this._mediator.on(c.d.EVENTS.OPERATION_CREATED,this._onOperationUpdated)}},{key:"_saveOperationsOptions",value:function(){var e=this,t=this.context.editor.operations;this._initialOptions={},this.constructor.updatableOperations.forEach(function(n){var i=t.get(n);i&&(e._initialOptions[n]=i.serializeOptions())})}},{key:"_shouldAddGlobalHistorySnapshot",value:function(){var e=this,t=this.context.editor,n=t.history,i=t.operations,r=u.Utils.Array.last(n.getItems().filter(function(e){return"global"===e.scope})),o=function(e,t){return!(!e&&!t||(!e||t||!e.hasChanges())&&(e||!t)&&(!e||!t||e.optionsEqual(t)))};return this.constructor.updatableOperations.some(function(t){var n=e._initialOptions[t],a=r?r.snapshot.operations[t]:null,s=i.get(t);return o(s,n)&&o(s,a)})}},{key:"_onEnter",value:function(){}},{key:"onLeave",value:function(){var e=this;return this.onBeforeLeave().then(function(t){"boolean"==typeof t&&(t={leave:t});var n=t,i=n.leave,r=n.data;if(!i)return!1;e._mediator.off(c.d.EVENTS.OPERATION_REMOVED,e._onOperationRemoved),e._mediator.off(c.d.EVENTS.OPERATION_UPDATED,e._onOperationUpdated),e._mediator.off(c.d.EVENTS.OPERATION_CREATED,e._onOperationUpdated),e._onLeave(r||{});var o=e.context.options,a=e.context.editor,s=a.history,l=a.operations;if(e._shouldAddGlobalHistorySnapshot()){var u=e._getGlobalHistoryData?e._getGlobalHistoryData():null;e.addGlobalHistorySnapshot(void 0,!1,u)}return l.removeUnused(),"global"===o.editor.undoMode&&s.removeControls(e.constructor.identifier,"local"),"local"===o.editor.undoMode&&s.removeControls(e.constructor.identifier,"global"),!0})}},{key:"_getGlobalHistoryData",value:function(){}},{key:"_onLeave",value:function(){}},{key:"onBeforeLeave",value:function(){return this._onBeforeLeave()}},{key:"_onBeforeLeave",value:function(){return l.a.resolve(!0)}},{key:"addLocalHistorySnapshot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.context.editor.history.addSnapshot("local",t,e,this.constructor.identifier,n)}},{key:"addGlobalHistorySnapshot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.context.editor.history.addSnapshot("global",t,e,this.constructor.identifier,n)}},{key:"getGlobalToolState",value:function(){return this.context.globalState.get(this.constructor.identifier)}},{key:"setGlobalToolState",value:function(e){this.context.globalState.set(function(e,t,n){return t in e?a()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.constructor.identifier,e))}},{key:"updateGlobalToolState",value:function(e){this.setGlobalToolState(p({},this.getGlobalToolState(),e))}},{key:"_onBeforeExport",value:function(){return l.a.resolve()}},{key:"_onAfterExport",value:function(){return l.a.resolve()}},{key:"onBeforeExport",value:function(){return this._onBeforeExport()}},{key:"onAfterExport",value:function(){return this._onAfterExport()}}],[{key:"getPreloadAssets",value:function(){return[]}},{key:"clickAtPosition",value:function(e){return!1}},{key:"isEnabled",value:function(e){var t=this.constructor.identifier;return e.isToolEnabled(t)&&e.isToolAllowed(t)}}]),e}();h.identifier=null,h.controlsComponent=null,h.canvasControlsComponent=f.a,h.defaultOptions={},h.requiredOperations=[],h.updatableOperations=[],h.switchToDefaultControlsOnRemoval=!0,t.a=h},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"render",value:function(){var e=function(e){return{animationDelay:.1*e+"s"}};return f.m.createElement(h,{styles:this.props.styles},f.m.createElement(_,{style:e(0)}),f.m.createElement(_,{style:e(1)}),f.m.createElement(_,{style:e(2)}))}}]),t}();d.contextTypes=f.b.contextTypes,t.a=d;var h=f.x.div("eurrvc","LoadingIndicatorContainer");d.RootElement=h;var _=f.x.div("vyyzkw","Ball")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(302),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onClick"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),d(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.value!==e.value||this.props.disabled!==e.disabled}},{key:"_onClick",value:function(){this._input.focus()}},{key:"render",value:function(){var e=this;return f.m.createElement(_,{className:this.props.className,onClick:this._onClick},f.m.createElement(g,{value:this.props.value,onLiveChange:this.props.onLiveChange,onChange:this.props.onChange,disabled:this.props.disabled,innerRef:function(t){e._input=t},name:this.props.name}),f.m.createElement(m,null,this.props.suffix))}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h;var _=f.x.div("nfd1oy","Container");h.RootElement=_;var m=f.x.div("1ua5bzq","Suffix"),g=Object(f.x)(p.a)("6ekjfo","Input")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(57),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.state.width=0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"_onInputChange",value:function(e){m(t.prototype.__proto__||p()(t.prototype),"_onInputChange",this).call(this,e),this._adjustWidth(e.target.value)}},{key:"shouldComponentUpdate",value:function(e,n){return m(t.prototype.__proto__||p()(t.prototype),"shouldComponentUpdate",this).call(this,e,n)||this.state.width!==n.width}},{key:"componentWillReceiveProps",value:function(e){this._adjustWidth(e.value)}},{key:"componentDidMount",value:function(){m(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._textRuler=document.createElement("div"),d.v.styleElement(this._textRuler,{position:"absolute",top:"0",left:"0",display:"inline-block",zIndex:10}),this._adjustWidth(this.props.value)}},{key:"_getInputStyle",value:function(){var e=this.state.width;return{width:e,minWidth:e}}},{key:"_adjustWidth",value:function(e){document.body.appendChild(this._textRuler);var t=d.v.getStyleObject(this._input);d.v.styleElement(this._textRuler,{font:t.font}),this._textRuler.innerText=e,this.setState({width:this._textRuler.offsetWidth}),this._textRuler.parentNode.removeChild(this._textRuler)}}]),t}();g.contextTypes=d.b.contextTypes,t.a=g,g.RootElement=Object(d.x)(h.a.RootElement)("n0hw7r","AutoSizeNumericInputComponent")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(146),d=n(53),h=n(147),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o.state={expanded:o.props.expanded||o.props.alwaysExpanded||!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),_(t,[{key:"_onClick",value:function(){var e=!this.state.expanded;this.props.alwaysExpanded||this.setState({expanded:e}),this.props.onToggle&&this.props.onToggle(e)}},{key:"componentWillReceiveProps",value:function(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}},{key:"render",value:function(){var e=this.props,t=e.alwaysExpanded,n=e.toggleable,i=e.className,r=this.state.expanded;return f.m.createElement(g,{styles:this.props.styles,className:i},f.m.createElement(v,{onClick:this._onClick.bind(this)},!t&&!n&&f.m.createElement(k,{turnUp:!r}),n&&f.m.createElement(w,{checked:r,className:void 0}),f.m.createElement(y,null,this.props.title)),f.m.createElement(d.a,{active:r,enterProp:"rendered",enterDuration:1e3*this.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*this.context.theme.transitionDuration,leaveDuration:1e3*this.context.theme.transitionDuration},f.m.createElement(b,{"data-expanded":r,className:void 0},this.props.children)))}}]),t}();m.contextTypes=f.b.contextTypes,t.a=m;var g=Object(f.x)(p.ControlGroup).div("1pofx54","Section");m.RootElement=g;var y=Object(f.x)(p.ControlGroupTitle).div("1b0fixa","SectionTitle"),v=f.x.div("1b4y7iu","SectionHeader"),b=f.x.div("10cp0qa",{rendered:"2jlos",visible:"82svov"},"SectionContent"),k=f.x.div("1bagiey",{turnUp:"gucvcl"},"ArrowDown"),w=Object(f.x)(h.a)("15tfhjl","Checkbox")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(85),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"_renderChild",value:function(e){return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_renderChild",this).call(this,d.m.createElement(g,{innerRef:this.props.innerListRef},e))}}]),t}();m.RootElement=h.a.RootElement,m.contextTypes=h.a.contextTypes;var g=d.x.div("1tmindq","ListWrapper"),y=Object(d.x)(m)("quhluw","ScrollbarContainer");t.a=y},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(87),_=n(145),m=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),g(t,[{key:"_buildSliderProps",value:function(){var e=this.props,t=e.minValue,n=e.maxValue,i=e.middleDot,r=e.onSliderValueChange;return{minValue:t,maxValue:n,value:e.value,middleDot:i,onChange:r,disabled:e.disabled}}},{key:"_renderLeftPart",value:function(){var e=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(this._buildSliderProps(),[]);return d.m.createElement(_.a,m({},e,{darkBackground:!0}))}}]),t}();y.contextTypes=h.a.contextTypes,t.a=y},function(e,t,n){e.exports={default:n(307),__esModule:!0}},function(e,t,n){n(308),e.exports=n(10).Number.isNaN},function(e,t,n){var i=n(11);i(i.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){"use strict";var i=n(20),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(310),_=n(53),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onDocumentClick","_onColorChange");var a=o._getColors(),s=o.props.value.clone(),l=a.findIndex(function(e){return e.equals(s)});return o.state={colorPickerVisible:!1,colors:a,selectedColorIndex:l},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),m(t,[{key:"componentWillReceiveProps",value:function(e){this.state.colorPickerVisible||this.props.value.equals(e.value)}},{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this._onDocumentClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this._onDocumentClick)}},{key:"_onDocumentClick",value:function(e){var t=this;if(this.state.colorPickerVisible){for(var n=e.target;n;n=n.parentNode)if(n===this._root)return;this.setState({colorPickerVisible:!1},function(){t.props.onColorPickerToggle&&t.props.onColorPickerToggle(!1)})}}},{key:"_onClick",value:function(e){var t=this,n={colorPickerVisible:this.state.colorPickerVisible,selectedColorIndex:e};e===this.state.selectedColorIndex?n.colorPickerVisible=!this.state.colorPickerVisible:n.colorPickerVisible=!1,this.props.onChange&&this.props.onChange(this.state.colors[e]),this.setState(n,function(){t.props.onColorPickerToggle&&t.props.onColorPickerToggle(n.colorPickerVisible)})}},{key:"_onColorChange",value:function(e){this.props.onChange&&this.props.onChange(e),this.state.colors[this.state.selectedColorIndex].copy(e),this.forceUpdate()}},{key:"_getColors",value:function(){return this.props.colorPalette&&this.props.colorPalette.length>0?[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return r()(e)}(this.props.colorPalette)):this._getDefaultColors()}},{key:"_getDefaultColors",value:function(){return[this.props.clearColorInDefaults?new d.c(0,0,0,0):d.c.WHITE.clone(),new d.c(.875,.875,.875,1),new d.c(.75,.75,.75,1),new d.c(.625,.625,.625,1),new d.c(.5,.5,.5,1),new d.c(.375,.375,.375,1),new d.c(.25,.25,.25,1),new d.c(.125,.125,.125,1),new d.c(0,0,0,1),d.c.fromHex("66CCFF"),d.c.fromHex("6686FF"),d.c.fromHex("8666FF"),d.c.fromHex("BD67E3"),d.c.fromHex("FF65CB"),d.c.fromHex("E75050"),d.c.fromHex("F28855"),d.c.fromHex("FECC66"),d.c.fromHex("FFF763")]}},{key:"_renderColorBubbles",value:function(){var e=this,t=this._getAssetPath("editor/controls/shared/tiled-background.png",!0),n=[];return this.state.colors.forEach(function(i,r){var o=r===e.state.selectedColorIndex;n.push(d.m.createElement(v,{key:r,selected:o,className:void 0},d.m.createElement(k,null,d.m.createElement(w,{style:{backgroundImage:"url("+t+")"}}),d.m.createElement(S,{style:{backgroundColor:i.toRGBA()},onClick:e._onClick.bind(e,r),className:void 0},d.m.createElement(b,{selected:o}),d.m.createElement(C,null,d.m.createElement(E,{selected:o}),d.m.createElement(E,{selected:o}),d.m.createElement(E,{selected:o})))),d.m.createElement(_.a,{active:o&&e.state.colorPickerVisible,enterProp:"rendered",enterDuration:1e3*e.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*e.context.theme.transitionDuration,leaveDuration:1e3*e.context.theme.transitionDuration},d.m.createElement(h.a,{color:i,onChange:e._onColorChange}))))}),n}},{key:"render",value:function(){var e=this;return d.m.createElement(y,{className:void 0,styles:this.props.styles,innerRef:function(t){e._root=t}},this._renderColorBubbles())}}]),t}();g.contextTypes=d.b.contextTypes,g.propTypes={colors:d.k.array,value:d.k.object.isRequired},t.a=g;var y=d.x.div("120c4v2","ColorSelection");g.RootElement=y;var v=d.x.div("1ds328h",{selected:"16ccmsf"},"ColorSelectionBubble"),b=d.x.div("i2obyt",{selected:"9c3pr8"},"InnerBorder"),k=d.x.div("h8zan2","ColorSelectionPreview"),w=d.x.div("yk72ip","ColorSelectionPreviewContent"),S=Object(d.x)(w)("nahwei","ColorSelectionBubbleContent"),C=d.x.div("1lws0px","DotContainer"),E=d.x.div("1lamas5",{selected:"xfn5qu"},"Dot")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(110),a=n.n(o),s=n(32),l=n.n(s),c=n(0),u=n.n(c),f=n(2),p=n.n(f),d=n(3),h=n.n(d),_=n(1),m=n.n(_),g=n(4),y=n(311),v=n(312),b=n(313),k=n(148),w=n(314),S=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},C=function(){return function(e,t){if(Array.isArray(e))return e;if(a()(Object(e)))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=l()(e);!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),u()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),x=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||m()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onHexValueChange","_onAlphaChange","_onHueChange","_onSaturationBrightnessChange");var a=o.props.color.clone(),s=a.toHSV(),l=C(s,3),c=l[0],u=l[1],f=l[2];return o.state={color:a,hue:c,saturation:u,brightness:f},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=h()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(p.a?p()(e,t):e.__proto__=t)}(t,g.b),E(t,[{key:"_onHexValueChange",value:function(e){if(!e.match(/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/i))return this.forceUpdate();3===e.length&&(e+=e);var t=g.c.fromHex(e),n=this.state.color;n.copy(t),this.props.onChange&&this.props.onChange(n.clone());var i=n.toHSV(),r=C(i,3),o=r[0],a=r[1],s=r[2];this.setState({hue:o,saturation:a,brightness:s})}},{key:"_onAlphaChange",value:function(e){var t=this.state.color;t.a=e,this.props.onChange&&this.props.onChange(t.clone()),this.forceUpdate()}},{key:"_onHueChange",value:function(e){var t=this.state.color,n=t.toHSV(),i=C(n,3),r=i[1],o=i[2],a=t.a;t.fromHSV(e,r,o),t.a=a,this.props.onChange&&this.props.onChange(t.clone()),this.setState({color:t,hue:e})}},{key:"_onSaturationBrightnessChange",value:function(e,t){var n=this.state.color,i=n.a;n.fromHSV(this.state.hue,e,t),n.a=i,this.props.onChange&&this.props.onChange(n.clone()),this.setState({color:n,saturation:e,brightness:t})}},{key:"_changeColorComponent",value:function(e,t){var n=this.state.color;n[e]=t/255,this.props.onChange&&this.props.onChange(n.clone());var i=n.toHSV(),r=C(i,3),o=r[0],a=r[1],s=r[2];this.setState({hue:o,saturation:a,brightness:s})}},{key:"_renderContent",value:function(){var e=this.state,t=e.hue,n=e.saturation,i=e.brightness,r=e.color,o={hue:t,saturation:n,brightness:i};return[g.m.createElement(O,{key:"arrow"}),g.m.createElement(R,{key:"colorPicker",className:void 0},g.m.createElement(D,S({},o,{onChange:this._onSaturationBrightnessChange})),g.m.createElement(I,S({},o,{onChange:this._onHueChange})),g.m.createElement(P,{value:r.a,color:r,onChange:this._onAlphaChange}),g.m.createElement(A,null,g.m.createElement(w.a,{inputLabel:"Hex",value:r.toHex().substr(1),inputClassName:void 0,onValueChange:this._onHexValueChange}),g.m.createElement(k.a,{inputLabel:"R",value:r.toRGB()[0],minValue:1,maxValue:255,inputClassName:void 0,onValueChange:this._changeColorComponent.bind(this,"r")}),g.m.createElement(k.a,{inputLabel:"G",value:r.toRGB()[1],minValue:1,maxValue:255,inputClassName:void 0,onValueChange:this._changeColorComponent.bind(this,"g")}),g.m.createElement(k.a,{inputLabel:"B",value:r.toRGB()[2],minValue:1,maxValue:255,inputClassName:void 0,onValueChange:this._changeColorComponent.bind(this,"b")})))]}},{key:"render",value:function(){var e=this.props,t=e.rendered,n=e.visible;return g.m.createElement(T,{rendered:t,visible:n},t&&this._renderContent())}}]),t}();x.contextTypes=g.b.contextTypes,t.a=x;var T=g.x.div("txlwuh",{rendered:"2jlos",visible:"zgbg08"},"ColorPickerContainer"),O=g.x.div("ts4br3","TopArrow"),R=g.x.div("1gzvppb","ColorPicker"),D=Object(g.x)(b.a)("120drhm","SaturationValueSlider"),I=Object(g.x)(y.a)("1cbv91b","HueSlider"),P=Object(g.x)(v.a)("tnkwnw","OpacitySlider"),A=g.x.div("142apfo","ColorValueInputs")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(21),_=n(88),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKnobDragStart","_onKnobDrag","_setValue"),o.state={value:o.props.hue},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),m(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._renderCanvas()}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.hue})}},{key:"_onKnobDragStart",value:function(e,t,n){this._sliderWidth=this._slider.offsetWidth,n.target===this._knob?this._initialValue=this.state.value:(this._initialValue=e.x/this._sliderWidth,this._setValue(this._initialValue))}},{key:"_onKnobDrag",value:function(e){var t=this._initialValue+e.x/this._sliderWidth;this._setValue(t)}},{key:"_setValue",value:function(e){var t=Math.min(1,Math.max(0,e));this.setState({value:t}),this.props.onChange&&this.props.onChange(t),this.forceUpdate()}},{key:"_renderCanvas",value:function(){var e=this._canvas,t=e.getContext("2d");e.width=e.offsetWidth,e.height=e.offsetHeight;for(var n=0;n<e.width;n++){var i=n/e.width,r=d.c.fromHSV(i,1,1);t.strokeStyle=r.toRGBA(),t.beginPath(),t.moveTo(n,0),t.lineTo(n,e.height),t.stroke()}}},{key:"render",value:function(){var e=this;return d.m.createElement(h.a,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag},d.m.createElement(y,{styles:this.props.styles,innerRef:function(t){e._slider=t},className:void 0},d.m.createElement(b,{innerRef:function(t){e._canvas=t}}),d.m.createElement(v,{style:this._getKnobStyle(),innerRef:function(t){e._knob=t},className:void 0})))}},{key:"_getKnobStyle",value:function(){return{left:(100*this.props.hue).toFixed(2)+"%"}}}]),t}();g.contextTypes=d.b.contextTypes,t.a=g;var y=Object(d.x)(_.a).div("120drhm","HueSlider");g.RootElement=y;var v=Object(d.x)(_.c).div("120drhm","Knob"),b=Object(d.x)(_.b).canvas("u98vhm","Background")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(21),d=n(88),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKnobDragStart","_onKnobDrag","_updateBackgroundColors","_setValue"),o.state={color:o.props.color.clone(),value:o.props.value},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),h(t,[{key:"_updateBackgroundColors",value:function(){this._transparentColor=this.state.color.clone(),this._transparentColor.a=0,this._opaqueColor=this.state.color.clone(),this._opaqueColor.a=1}},{key:"componentWillReceiveProps",value:function(e){this.setState({color:e.color.clone(),value:e.value})}},{key:"_onKnobDragStart",value:function(e,t,n){this._sliderWidth=this._slider.offsetWidth,n.target===this._knob?this._initialValue=this.state.value:(this._initialValue=1-e.x/this._sliderWidth,this._setValue(this._initialValue))}},{key:"_onKnobDrag",value:function(e,t){var n=this._initialValue-e.x/this._sliderWidth;this._setValue(n)}},{key:"_setValue",value:function(e){var t=Math.min(1,Math.max(0,e));this.props.onChange&&this.props.onChange(t),this.setState({value:t}),this.forceUpdate()}},{key:"render",value:function(){var e=this;this._updateBackgroundColors();var t=this._getAssetPath("editor/controls/shared/tiled-background.png",!0);return f.m.createElement(p.a,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag},f.m.createElement(m,{styles:this.props.styles,innerRef:function(t){e._slider=t},className:void 0},f.m.createElement(v,{style:{backgroundImage:"url("+t+")"}}),f.m.createElement(y,{style:{backgroundImage:"linear-gradient(90deg, "+this._opaqueColor.toRGBA()+" 0%, "+this._transparentColor.toRGBA()+" 100%)"}}),f.m.createElement(g,{style:this._getKnobStyle(),innerRef:function(t){e._knob=t},className:void 0})))}},{key:"_getKnobStyle",value:function(){return{left:(100*(1-this.state.value)).toFixed(2)+"%"}}}]),t}();_.contextTypes=f.b.contextTypes,t.a=_;var m=Object(f.x)(d.a).div("120drhm","OpacitySlider");_.RootElement=m;var g=Object(f.x)(d.c).div("120drhm","Knob"),y=Object(f.x)(d.b).div("120drhm","Background"),v=Object(f.x)(y)("m87q12","TiledBackground")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(21),_=n(88),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKnobDragStart","_onKnobDrag"),o._lastHue=null,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),m(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._renderCanvas()}},{key:"componentDidUpdate",value:function(){this.props.hue!==this._lastHue&&this._renderCanvas()}},{key:"_onKnobDragStart",value:function(e,t,n){n.target===this._knob?(this._initialBrightness=this.props.brightness,this._initialSaturation=this.props.saturation):(this._initialSaturation=e.x/this._canvas.offsetWidth,this._initialBrightness=1-e.y/this._canvas.offsetHeight,this.props.onChange&&this.props.onChange(this._initialSaturation,this._initialBrightness))}},{key:"_onKnobDrag",value:function(e){if(null!=this._canvas){var t=this._canvas.offsetWidth,n=this._canvas.offsetHeight,i=this._initialSaturation+e.x/t;i=Math.max(0,Math.min(1,i));var r=this._initialBrightness+e.y/n*-1;r=Math.max(0,Math.min(1,r)),this.props.onChange&&this.props.onChange(i,r)}}},{key:"_renderCanvas",value:function(){var e=this._canvas,t=e.getContext("2d");e.width=e.offsetWidth,e.height=e.offsetHeight;for(var n=t.getImageData(0,0,e.width,e.height),i=0;i<e.height;i++)for(var r=(e.height-i)/e.height,o=0;o<e.width;o++){var a=o/e.width,s=d.c.fromHSV(this.props.hue,a,r),l=s.r,c=s.g,u=s.b,f=s.a,p=4*(i*e.width+o);n.data[p]=255*l,n.data[p+1]=255*c,n.data[p+2]=255*u,n.data[p+3]=255*f}t.putImageData(n,0,0),this._lastHue=this.props.hue}},{key:"render",value:function(){var e=this;return d.m.createElement(h.a,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag},d.m.createElement(y,{styles:this.props.styles,innerRef:function(t){e._slider=t},className:void 0},d.m.createElement(b,{innerRef:function(t){e._canvas=t}}),d.m.createElement(v,{style:this._getKnobStyle(),innerRef:function(t){e._knob=t},className:void 0})))}},{key:"_getKnobStyle",value:function(){return{left:(100*this.props.saturation).toFixed(2)+"%",top:(100*(1-this.props.brightness)).toFixed(2)+"%"}}}]),t}();g.contextTypes=d.b.contextTypes,t.a=g;var y=Object(d.x)(_.a).div("1jf8fwr","SaturationValueSlider");g.RootElement=y;var v=Object(d.x)(_.c).div("icy3f1","Knob"),b=Object(d.x)(_.b).canvas("15alfoa","Background")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(148),d=n(57),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.a),h(t,[{key:"_onInputChange",value:function(e){var t=e.target.value;if(t.match(/^#([A-Fa-f0-9]{6})$/))return this.setState({value:this.props.value});this.props.onValueChange&&this.props.onValueChange(t),this.setState({value:t})}},{key:"_renderRightPart",value:function(){var e=this,t=[];return this.props.inputClassName&&t.push(this.props.inputClassName),f.m.createElement(m,{value:this.state.value,onLiveChange:this._onInputLiveChange,onChange:this._onInputChange,className:t.join(" "),innerRef:function(t){e._input=t},disabled:this.props.disabled})}}]),t}();_.contextTypes=p.a.contextTypes,t.a=_;var m=Object(f.x)(d.a)("t0ruqq","InputField")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"render",value:function(){return f.m.createElement(h,{onClick:this.props.disabled?void 0:this.props.onClick,disabled:this.props.disabled,className:this.props.className},this.props.title)}}]),t}();d.contextTypes=f.b.contextTypes,t.a=d;var h=f.x.button("7lpbp3",{disabled:"1iaw3op"},"Button")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(86),_=n(85),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},y=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onDropdownClick","_onDocumentClick"),o.state={expanded:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.b),m(t,[{key:"componentDidMount",value:function(){g(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),document.addEventListener("click",this._onDocumentClick)}},{key:"componentWillUnmount",value:function(){g(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),document.removeEventListener("click",this._onDocumentClick)}},{key:"_onDocumentClick",value:function(e){if(this.state.expanded){for(var t=e.target;t;t=t.parentNode)if(t===this._root)return;this.setState({expanded:!1})}}},{key:"_onDropdownClick",value:function(){var e=this.state.expanded;this.setState({expanded:!e})}},{key:"_onItemClick",value:function(e){this.props.onChange&&this.props.onChange(e),this.setState({expanded:!1})}},{key:"_renderDropdownItems",value:function(){var e=this;return this.props.children.map(function(t){var n=d.r.extend({},t.props,{onClick:e._onItemClick.bind(e,t.props.value),selected:e.props.value===t.props.value,className:void 0});return d.m.cloneElement(t,n)})}},{key:"render",value:function(){var e=this,t=null;this.props.children.forEach(function(n){n.props.value===e.props.value&&(t=n.props.children)});var n=this.props.enableMenu;return d.m.createElement(v,{innerRef:function(t){e._root=t},className:this.props.className},d.m.createElement(b,{onClick:n?this._onDropdownClick:null,styles:this.props.styles,style:this.props.style},t,n?d.m.createElement(S,null):null),this.state.expanded&&d.m.createElement(k,{className:void 0},d.m.createElement(_.a,{direction:"vertical",noGradient:!0},d.m.createElement(w,null,this._renderDropdownItems()))))}}]),t}();y.contextTypes=d.b.contextTypes,y.propTypes={enableMenu:d.k.bool,styles:d.k.object,style:d.k.object,onChange:d.k.func},y.defaultProps={enableMenu:!0},t.a=y;var v=d.x.div("13hv8io","DropdownContainer"),b=Object(d.x)(h.a).div("13hv8io","Dropdown");y.RootElement=b;var k=d.x.div("1fqdopp","DropdownOverlay"),w=d.x.ul("zy0cu9","DropdownList"),S=d.x.div("7w2heg",{turnUp:"gucvcl"},"ArrowDown"),C=d.x.li("cibatp",{selected:"60ro2s"},"DropdownItem");y.Item=C,y.RootElement=Object(d.x)(h.a).input("120drhm","DropdownComponent")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=n(86),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onKeyDown","_onInputBlur","_onInputChange"),o.state={value:""},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),d(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.value!==e.value||this.props.disabled!==e.disabled||this.state.value!==t.value}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"_onInputChange",value:function(e){this.setState({value:e.target.value}),this.props.onLiveChange&&this.props.onLiveChange(e)}},{key:"_onInputBlur",value:function(e){this.props.onChange&&this.props.onChange(e)}},{key:"_onKeyDown",value:function(e){13!==e.keyCode&&27!==e.keyCode||this._input.blur(),this.props.onKeyDown&&this.props.onKeyDown()}},{key:"focus",value:function(){this._input.focus()}},{key:"_getInputStyle",value:function(){return{}}},{key:"render",value:function(){var e=this,t=this.constructor.RootElement;return f.m.createElement(t,{value:this.state.value,placeholder:this.props.placeholder,onChange:this._onInputChange,onBlur:this._onInputBlur,innerRef:function(t){e._input=t},onKeyDown:this._onKeyDown,name:this.props.name,styles:this.props.styles,className:this.props.className,style:this._getInputStyle(),disabled:this.props.disabled})}}]),t}();h.contextTypes=f.b.contextTypes,t.a=h,h.RootElement=Object(f.x)(p.a).input("120drhm","TextInputComponent")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(4),m=n(21),g=n(78),y=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o._pressedKeysMap={},o._bindAll("_onKeyDown","_onKeyUp","_onCanvasFocus"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,m.a),v(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this.refs.element&&(this._element=this.refs.element),this.props.enableShortcuts&&(this.addShortcutListeners(),this._focus())}},{key:"componentWillReceiveProps",value:function(e){return!e.disabled&&(e.enableShortcuts&&!e.disabled&&this._element.focus(),!0)}},{key:"componentWillUnmount",value:function(){this.props.enableShortcuts&&this.removeShortcutListeners()}},{key:"_focus",value:function(){if(this.props.disabled)return!1;this.props.enableShortcuts&&this._element&&this._element!==document.activeElement&&this._element.focus()}},{key:"addShortcutListeners",value:function(){this.context.mediator.on(g.a.CANVAS_FOCUS,this._onCanvasFocus),this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp)}},{key:"removeShortcutListeners",value:function(){this.context.mediator.off(g.a.CANVAS_FOCUS,this._onCanvasFocus),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp)}},{key:"_onCanvasFocus",value:function(){this._focus()}},{key:"_onKeyDown",value:function(e){if(!this.props.disabled){var n=t._getUnifiedArrowKeyName(e.key);this._pressedKeysMap[n]=!0,"ArrowUp"!==n&&"ArrowDown"!==n&&"ArrowLeft"!==n&&"ArrowRight"!==n||this._handleKeyboardMove(e),this._pressedKeysMap.Backspace&&this._handleKeyboardDelete(e)}}},{key:"_handleKeyboardDelete",value:function(e){this.props.onKeyboardDelete&&this.props.onKeyboardDelete(e)}},{key:"_handleKeyboardMove",value:function(e){if(this.props.onKeyboardMove){e.preventDefault(),e.stopPropagation();var t=new _.w(0,0),n=this._pressedKeysMap,i=n.ArrowRight,r=n.ArrowLeft,o=n.ArrowUp,a=n.ArrowDown,s=n.Shift;i&&t.add(8,0),r&&t.add(-8,0),o&&t.add(0,-8),a&&t.add(0,8),s&&t.multiply(6,6),this.props.onKeyboardMove(t)}}},{key:"_onKeyUp",value:function(e){if(!this.props.disabled){var n=t._getUnifiedArrowKeyName(e.key);delete this._pressedKeysMap[n]}}}],[{key:"_getUnifiedArrowKeyName",value:function(e){switch(e){case"Down":case"ArrowDown":return"ArrowDown";case"Up":case"ArrowUp":return"ArrowUp";case"Left":case"ArrowLeft":return"ArrowLeft";case"Right":case"ArrowRight":return"ArrowRight";case"Esc":case"Escape":return"Escape";default:return e}}}]),t}();b.contextTypes=_.b.contextTypes,b.propTypes=y({},m.a.propTypes,{enableShortcuts:_.k.bool,onKeyboardMove:_.k.func,onKeyboardDelete:_.k.func}),t.a=b},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(32),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(144),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onNewFiles"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.b),_(t,[{key:"componentDidMount",value:function(){this._fileLoader=new h.a(this._fileInput),this._fileLoader.on("files",this._onNewFiles)}},{key:"componentWillUnmount",value:function(){this._fileLoader.off("files",this._onNewFiles),this._fileLoader.dispose(),this._fileLoader=null}},{key:"_onNewFiles",value:function(e){if(this.props.onNewFile){var t=!0,n=!1,i=void 0;try{for(var r,o=u()(e);!(t=(r=o.next()).done);t=!0){var a=r.value;this.props.onNewFile(a.image,a.name)}}catch(e){n=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw i}}}}},{key:"open",value:function(){this._fileLoader.open()}},{key:"render",value:function(){var e=this;return d.m.createElement(g,{type:"file",multiple:this.props.acceptsMultiple,accept:"image/*",innerRef:function(t){e._fileInput=t}})}}]),t}();m.contextTypes=d.b.contextTypes,t.a=m;var g=d.x.input("19u9mq5","HiddenFileInput")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(4),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.b),p(t,[{key:"_cancelEvent",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"_onClick",value:function(e,t){t.stopPropagation(),t.preventDefault(),e(t)}},{key:"_renderControlItem",value:function(e,t){var n=this,i=this._getAssetPath("editor/controls/shared/canvas-overlay-controls/"+e+".png",!0),r=function(e){n._onClick(t,e)};return f.m.createElement(_,{style:{backgroundImage:"url("+i+")"},onClick:r,onTouchEnd:r,className:void 0,"data-identifier":e})}},{key:"render",value:function(){var e=this.props,t=e.position,n=e.isTextMaskingInverted;return f.m.createElement(h,{style:{left:t.x,top:t.y},onMouseDown:this._cancelEvent,onTouchStart:this._cancelEvent,className:void 0},this.props.takeToFront&&this._renderControlItem("to-front",this.props.onTakeToFront),this.props.maskCanvas&&this._renderControlItem(n?"text-background":"text-foreground",this.props.onMaskCanvas),this.props.flipHorizontally&&this._renderControlItem("flip-horizontal",this.props.onFlipHorizontally),this.props.duplicate&&this._renderControlItem("duplicate",this.props.onDuplicate),this.props.delete&&this._renderControlItem("delete",this.props.onDelete))}}]),t}();d.contextTypes=f.b.contextTypes,t.a=d;var h=f.x.div("1lf1r1r","CanvasOverlayControl"),_=f.x.div("1l53y3r","ControlItem")},function(e,t){e.exports={pesdk:{common:{title:{error:"Fehler"},text:{loading:"Lade..."},button:{cancel:"Abbrechen"}},editor:{button:{export:"Exportieren",save:"Speichern",load:"Laden",newImageChangesLostWarningYes:"Ja",newImageChangesLostWarningNo:"Nein",discardChangesWarningKeep:"Änderungen beibehalten",discardChangesWarningDiscard:"Änderungen verwerfen"},title:{newImageChangesLostWarning:"Neues Bild",imageResizedWarning_maxMegaPixels:"Bild verkleinert",imageResizedWarning_maxDimensions:"Bild verkleinert",fontLoadingError:"Laden von Schriftarten ist fehlgeschlagen.",discardChangesWarning:"Änderungen verwerfen?"},text:{newImageChangesLostWarning:"Alle nicht gespeicherten Änderungen gehen verloren. Fortfahren?",imageResizedWarning_maxMegaPixels:"Da dein Bild die maximale Größe von ${maxMegaPixels} Megapixeln überschreitet, wurde es auf ${width}x${height} Pixel verkleinert.",imageResizedWarning_maxDimensions:"Aufgrund von Hardware-Beschränkungen wurde das Bild auf ${width}x${height} Pixel verkleinert.",renderingError:"Beim Rendern des Bildes ist ein Fehler aufgetreten.",exporting:"Exportiere...",saving:"Speichere...",loading:"Loading...",resizing:"Bild wird bearbeitet...",loadingFonts:"Lade Schriftarten...",fontLoadingError:"Die folgenden Schriftarten konnten nicht geladen werden: ${fonts}.",webcamUnavailableError:"Webcam-Bild kann nicht dargestellt werden. (Fehler: ${error})",invalidFileTypeError:"Der Dateityp ${fileType} wird nicht unterstützt.",imageLoadingError:"Laden des Bildes fehlgeschlagen. Dies kann verschiedene Gründe haben, beispielsweise kann die Datei defekt sein oder der Dateityp wird nicht unterstützt.",discardChangesWarning:"Sind Sie sicher, dass Sie die Änderungen verwerfen wollen?"}},library:{title:{name:"Bibliothek"},button:{fileDropZone:"Datei hier hin ziehen oder klicken zum Durchsuchen.",fileDropZoneHovered:"Zum Hochladen loslassen."},placeholder:{search:"Bibliothek durchsuchen"},text:{noResults:"Keine Ergebnisse"}},transform:{title:{name:"Zuschneiden"},dimensions:{lock:"Fixiere Auflösung"},button:{reset:"Zurücksetzen"},asset:{imgly_transforms_common:{name:"Standard",asset:{imgly_transform_common_custom:"Frei",imgly_transform_common_square:"Quadratisch","imgly_transform_common_4-3":"4:3","imgly_transform_common_16-9":"16:9"}},imgly_transforms_facebook:{name:"Facebook",asset:{imgly_transform_facebook_ad:"Ad",imgly_transform_facebook_post:"Post",imgly_transform_facebook_cover:"Cover",imgly_transform_facebook_profile:"Profile Pic"}}},placeholder:{width:"b",height:"h"}},filter:{asset:{identity:"Kein Filter",imgly_lut_celsius:"Inferno",imgly_lut_chest:"Chestnut",imgly_lut_fixie:"Fixie",imgly_lut_fridge:"Fridge",imgly_lut_front:"Sunny 70s",imgly_lut_k2:"Flat Black",imgly_lut_mellow:"Mellow",imgly_lut_sin:"Hard Stuff",imgly_lut_texas:"Oldtimer",imgly_lut_ad1920:"1920 A.D.",imgly_lut_ancient:"Ancient",imgly_lut_bleached:"Kalmen",imgly_lut_bleachedblue:"Joran",imgly_lut_blues:"Polaroid",imgly_lut_blueshadows:"Zephyr",imgly_lut_breeze:"Levante",imgly_lut_bw:"Greyed",imgly_lut_classic:"Classic",imgly_lut_colorful:"Colorful",imgly_lut_cool:"Snappy",imgly_lut_cottoncandy:"Candy",imgly_lut_creamy:"Creamy",imgly_lut_eighties:"Low Fire",imgly_lut_elder:"Colla",imgly_lut_evening:"Sunrise",imgly_lut_fall:"Moss",imgly_lut_food:"Food",imgly_lut_glam:"Glam",imgly_lut_gobblin:"Gobblin",imgly_lut_highcarb:"High Carb",imgly_lut_highcontrast:"Hicon",imgly_lut_k1:"K1",imgly_lut_k6:"K6",imgly_lut_kdynamic:"Pebble",imgly_lut_keen:"Keen",imgly_lut_lenin:"Lemon",imgly_lut_litho:"Litho",imgly_lut_lomo:"Lomo",imgly_lut_lomo100:"Lomo 100",imgly_lut_lucid:"Lucid",imgly_lut_neat:"Neat",imgly_lut_nogreen:"Pumpkin",imgly_lut_orchid:"Solanus",imgly_lut_pale:"Pale",imgly_lut_pitched:"Pitched",imgly_lut_plate:"Weathered",imgly_lut_pola669:"Green Gap",imgly_lut_polasx:"Pola SX",imgly_lut_pro400:"Pro 400",imgly_lut_quozi:"Quozi",imgly_lut_sepiahigh:"Sepia",imgly_lut_settled:"Settled",imgly_lut_seventies:"Seventies",imgly_lut_soft:"Soft",imgly_lut_steel:"Steel",imgly_lut_summer:"Summer",imgly_lut_sunset:"Golden",imgly_lut_tender:"Tender",imgly_lut_twilight:"Twilight",imgly_lut_winter:"Softy",imgly_lut_x400:"Dusty",imgly_duotone_desert:"Desert",imgly_duotone_peach:"Peach",imgly_duotone_clash:"Clash",imgly_duotone_plum:"Plum",imgly_duotone_breezy:"Breezy",imgly_duotone_deepblue:"Deep Blue",imgly_duotone_frog:"Frog",imgly_duotone_sunset:"Sunset"},title:{name:"Filters"}},adjustments:{button:{reset:"Zurücksetzen"},title:{name:"Korrekturen",basics:"Grundlagen",refinements:"Feinheiten"},text:{brightness:"Helligkeit",saturation:"Sättigung",contrast:"Kontrast",gamma:"Gamma",sharpness:"Schärfe",clarity:"Klarheit",exposure:"Belichtung",shadows:"Schatten",highlights:"Lichter",whites:"Weiß",blacks:"Schwarz",temperature:"Temperatur"}},focus:{title:{name:"Weichzeichnen"},button:{none:"Original",radial:"Kreisförmig",mirrored:"Gespiegelt",linear:"Linear",gaussian:"Gaußsch"}},text:{title:{name:"Text",font:"Schriftart",size:"Größe",spacing:"Abstand",line:"Zeile",background:"Hintergrund"},placeholder:{defaultText:"Doppelklick zum Bearbeiten!"},button:{new:"Neuer Text"}},textdesign:{title:{name:"Text Design",input:"Text"},button:{invert:"Text als Maske",new:"Neues Text Design"}},sticker:{title:{name:"Sticker",opacity:"Transparenz"},text:{stickerLoadingError:"Laden des Stickers ${path} fehlgeschlagen."},button:{upload:"Hochladen",replace:"Ersetzen",new:"Neuer Sticker",fill:"Einfärben"},asset:{imgly_sticker_custom:"Eigene Sticker",imgly_sticker_emoticons:"Emoticons",imgly_sticker_emoticons_alien:"Alien",imgly_sticker_emoticons_angel:"Angel",imgly_sticker_emoticons_angry:"Angry",imgly_sticker_emoticons_anxious:"Anxious",imgly_sticker_emoticons_asleep:"Asleep",imgly_sticker_emoticons_attention:"Attention",imgly_sticker_emoticons_baby_chicken:"Baby Chicken",imgly_sticker_emoticons_batman:"Batman",imgly_sticker_emoticons_beer:"Beer",imgly_sticker_emoticons_black:"Black",imgly_sticker_emoticons_blue:"Blue",imgly_sticker_emoticons_blush:"Blush",imgly_sticker_emoticons_boxer:"Boxer",imgly_sticker_emoticons_business:"Business",imgly_sticker_emoticons_chicken:"Chicken",imgly_sticker_emoticons_cool:"Cool",imgly_sticker_emoticons_cry:"Cry",imgly_sticker_emoticons_deceased:"Deceased",imgly_sticker_emoticons_devil:"Devil",imgly_sticker_emoticons_duckface:"Duckface",imgly_sticker_emoticons_furious:"Furious",imgly_sticker_emoticons_grin:"Grin",imgly_sticker_emoticons_guitar:"Guitar",imgly_sticker_emoticons_harry_potter:"Harry Potter",imgly_sticker_emoticons_hippie:"Hippie",imgly_sticker_emoticons_hitman:"Hitman",imgly_sticker_emoticons_humourous:"Humourous",imgly_sticker_emoticons_idea:"Idea",imgly_sticker_emoticons_impatient:"Impatient",imgly_sticker_emoticons_kiss:"Kiss",imgly_sticker_emoticons_kisses:"Kisses",imgly_sticker_emoticons_laugh:"Laugh",imgly_sticker_emoticons_loud_cry:"Loud Cry",imgly_sticker_emoticons_loving:"Loving",imgly_sticker_emoticons_masked:"Masked",imgly_sticker_emoticons_music:"Music",imgly_sticker_emoticons_nerd:"Nerd",imgly_sticker_emoticons_ninja:"Ninja",imgly_sticker_emoticons_not_speaking_to_you:"Not speaking to you",imgly_sticker_emoticons_pig:"Pig",imgly_sticker_emoticons_pumpkin:"Pumpkin",imgly_sticker_emoticons_question:"Question",imgly_sticker_emoticons_rabbit:"Rabbit",imgly_sticker_emoticons_sad:"Sad",imgly_sticker_emoticons_sick:"Sick",imgly_sticker_emoticons_skateboard:"Skateboard",imgly_sticker_emoticons_skull:"Skull",imgly_sticker_emoticons_sleepy:"Sleepy",imgly_sticker_emoticons_smile:"Smile",imgly_sticker_emoticons_smoking:"Smoking",imgly_sticker_emoticons_sobbing:"Sobbing",imgly_sticker_emoticons_star:"Star",imgly_sticker_emoticons_steaming_furious:"Steaming Furious",imgly_sticker_emoticons_sunbathing:"Sunbathing",imgly_sticker_emoticons_tired:"Tired",imgly_sticker_emoticons_tongue_out_wink:"Tongue out wink",imgly_sticker_emoticons_wave:"Wave",imgly_sticker_emoticons_wide_grin:"Wide Grin",imgly_sticker_emoticons_wink:"Wink",imgly_sticker_emoticons_wrestler:"Wrestler",imgly_sticker_shapes:"Shapes",imgly_sticker_shapes_arrow_02:"Arrow 1",imgly_sticker_shapes_arrow_03:"Arrow 2",imgly_sticker_shapes_badge_01:"Badge 1",imgly_sticker_shapes_badge_11:"Badge 5",imgly_sticker_shapes_badge_12:"Badge 6",imgly_sticker_shapes_badge_13:"Badge 7",imgly_sticker_shapes_badge_15:"Badge 8",imgly_sticker_shapes_badge_18:"Badge 9",imgly_sticker_shapes_badge_19:"Badge 10",imgly_sticker_shapes_badge_20:"Badge 11",imgly_sticker_shapes_badge_28:"Badge 12",imgly_sticker_shapes_badge_32:"Badge 13",imgly_sticker_shapes_badge_35:"Badge 14",imgly_sticker_shapes_badge_36:"Badge 15",imgly_sticker_shapes_badge_04:"Badge 2",imgly_sticker_shapes_badge_06:"Badge 3",imgly_sticker_shapes_badge_08:"Badge 4",imgly_sticker_shapes_spray_01:"Spray 1",imgly_sticker_shapes_spray_03:"Spray 2",imgly_sticker_shapes_spray_04:"Spray 3"}},brush:{title:{name:"Malen",width:"Dicke",hardness:"Härte",settings:"Pinseleinstellungen"}},frame:{title:{name:"Rahmen",opacity:"Transparenz",width:"Dicke"},button:{fill:"Einfärben",replace:"Ersetzen",none:"Kein Rahmen"},asset:{imgly_frame_dia:"Dia",imgly_frame_art_decor:"Art Decor",imgly_frame_black_passepartout:"Black Passepartout",imgly_frame_lowpoly_shadow:"Low Poly",imgly_frame_wood_passepartout:"Wood Passepartout"}},overlay:{title:{name:"Overlay",blending:"Mischung",none:"Keine",normal:"Normal",overlay:"Overlay",hardLight:"Hard Light",softLight:"Soft Light",multiply:"Multiply",darken:"Darken",lighten:"Lighten",screen:"Screen",colorBurn:"Color Burn"},button:{none:"Kein Overlay"},asset:{imgly_overlay_bokeh:"Bokeh",imgly_overlay_chop:"Chop",imgly_overlay_clouds:"Clouds",imgly_overlay_golden:"Golden",imgly_overlay_grain:"Grain",imgly_overlay_hearts:"Hearts",imgly_overlay_lightleak1:"Light Leak 1",imgly_overlay_lightleak2:"Light Leak 2",imgly_overlay_metal:"Metal",imgly_overlay_mosaic:"Mosaic",imgly_overlay_painting:"Painting",imgly_overlay_paper:"Paper",imgly_overlay_rain:"Rain",imgly_overlay_vintage:"Vintage",imgly_overlay_wall1:"Wall",imgly_overlay_wall2:"Wall 2",imgly_overlay_wood:"Wood"}}}}},function(e,t){e.exports={pesdk:{common:{title:{error:"Error"},text:{loading:"Loading...",updating:"Updating..."},button:{cancel:"Cancel"}},editor:{button:{export:"Export",save:"Save",load:"Load",close:"Close",newImageChangesLostWarningYes:"Yes",newImageChangesLostWarningNo:"No",discardChangesWarningKeep:"Keep changes",discardChangesWarningDiscard:"Discard changes"},title:{newImageChangesLostWarning:"New Image",imageResizedWarning_maxMegaPixels:"Image resized",imageResizedWarning_maxDimensions:"Image resized",fontLoadingError:"Failed to load font",discardChangesWarning:"Discard changes?"},text:{newImageChangesLostWarning:"Any unsaved changes will be lost. Continue?",imageResizedWarning_maxMegaPixels:"Your image exceeds the maximum size of ${maxMegaPixels} megapixels and has therefore been resized to ${width}x${height} pixels.",imageResizedWarning_maxDimensions:"Due to hardware limitations your image has been resized to ${width}x${height} pixels.",renderingError:"An error has occurred while rendering the image.",exporting:"Exporting...",saving:"Saving...",loading:"Loading...",resizing:"Resizing...",loadingFonts:"Loading fonts...",fontLoadingError:"The following fonts could not be loaded: ${fonts}.",webcamUnavailableError:"Unable to display webcam image (Error: ${error})",invalidFileTypeError:"The file type ${fileType} is not supported.",imageLoadingError:"Failed to load image. This can have multiple reasons, e.g. the file is corrupted or the file type is not supported.",discardChangesWarning:"You have unsaved changes. Are you sure you want to discard the changes?"}},library:{title:{name:"Library"},button:{fileDropZone:"Drag image here or click to browse for one.",fileDropZoneHovered:"Drop to upload."},placeholder:{search:"Search Library"},text:{noResults:"No results"}},transform:{title:{name:"Transform"},dimensions:{lock:"Lock Resolution"},button:{reset:"Reset Default"},asset:{imgly_transforms_common:{name:"Common Crops",asset:{imgly_transform_common_custom:"Custom",imgly_transform_common_square:"Square","imgly_transform_common_4-3":"4:3","imgly_transform_common_16-9":"16:9"}},imgly_transforms_facebook:{name:"Facebook",asset:{imgly_transform_facebook_ad:"Ad",imgly_transform_facebook_post:"Post",imgly_transform_facebook_cover:"Cover",imgly_transform_facebook_profile:"Profile Pic"}}},placeholder:{width:"w",height:"h"}},filter:{asset:{identity:"None",imgly_lut_celsius:"Inferno",imgly_lut_chest:"Chestnut",imgly_lut_fixie:"Fixie",imgly_lut_fridge:"Fridge",imgly_lut_front:"Sunny 70s",imgly_lut_k2:"Flat Black",imgly_lut_mellow:"Mellow",imgly_lut_sin:"Hard Stuff",imgly_lut_texas:"Oldtimer",imgly_lut_ad1920:"1920 A.D.",imgly_lut_ancient:"Ancient",imgly_lut_bleached:"Kalmen",imgly_lut_bleachedblue:"Joran",imgly_lut_blues:"Polaroid",imgly_lut_blueshadows:"Zephyr",imgly_lut_breeze:"Levante",imgly_lut_bw:"Greyed",imgly_lut_classic:"Classic",imgly_lut_colorful:"Colorful",imgly_lut_cool:"Snappy",imgly_lut_cottoncandy:"Candy",imgly_lut_creamy:"Creamy",imgly_lut_eighties:"Low Fire",imgly_lut_elder:"Colla",imgly_lut_evening:"Sunrise",imgly_lut_fall:"Moss",imgly_lut_food:"Food",imgly_lut_glam:"Glam",imgly_lut_gobblin:"Gobblin",imgly_lut_highcarb:"High Carb",imgly_lut_highcontrast:"Hicon",imgly_lut_k1:"K1",imgly_lut_k6:"K6",imgly_lut_kdynamic:"Pebble",imgly_lut_keen:"Keen",imgly_lut_lenin:"Lemon",imgly_lut_litho:"Litho",imgly_lut_lomo:"Lomo",imgly_lut_lomo100:"Lomo 100",imgly_lut_lucid:"Lucid",imgly_lut_neat:"Neat",imgly_lut_nogreen:"Pumpkin",imgly_lut_orchid:"Solanus",imgly_lut_pale:"Pale",imgly_lut_pitched:"Pitched",imgly_lut_plate:"Weathered",imgly_lut_pola669:"Green Gap",imgly_lut_polasx:"Pola SX",imgly_lut_pro400:"Pro 400",imgly_lut_quozi:"Quozi",imgly_lut_sepiahigh:"Sepia",imgly_lut_settled:"Settled",imgly_lut_seventies:"Seventies",imgly_lut_soft:"Soft",imgly_lut_steel:"Steel",imgly_lut_summer:"Summer",imgly_lut_sunset:"Golden",imgly_lut_tender:"Tender",imgly_lut_twilight:"Twilight",imgly_lut_winter:"Softy",imgly_lut_x400:"Dusty",imgly_duotone_desert:"Desert",imgly_duotone_peach:"Peach",imgly_duotone_clash:"Clash",imgly_duotone_plum:"Plum",imgly_duotone_breezy:"Breezy",imgly_duotone_deepblue:"Deep Blue",imgly_duotone_frog:"Frog",imgly_duotone_sunset:"Sunset"},title:{name:"Filters"}},adjustments:{button:{reset:"Reset Default"},title:{name:"Adjust",basics:"Basics",refinements:"Refinements"},text:{brightness:"Brightness",saturation:"Saturation",contrast:"Contrast",gamma:"Gamma",sharpness:"Sharpness",clarity:"Clarity",exposure:"Exposure",shadows:"Shadows",highlights:"Highlights",whites:"Whites",blacks:"Blacks",temperature:"Temperature"}},focus:{title:{name:"Focus"},button:{none:"None",radial:"Radial",mirrored:"Mirrored",linear:"Linear",gaussian:"Gaussian"}},text:{title:{name:"Text",font:"Font",size:"Size",spacing:"Spacing",line:"Line",background:"Background"},placeholder:{defaultText:"Double-click to edit!"},button:{new:"New Text"}},textdesign:{title:{name:"Text Design",input:"Text"},button:{invert:"Text as mask",new:"New Text Design"}},sticker:{title:{name:"Stickers",opacity:"Opacity"},text:{stickerLoadingError:"Failed to load sticker ${path}."},button:{upload:"Upload",replace:"Replace",new:"New Sticker",fill:"Fill"},asset:{imgly_sticker_custom:"Custom",imgly_sticker_emoticons:"Emoticons",imgly_sticker_emoticons_alien:"Alien",imgly_sticker_emoticons_angel:"Angel",imgly_sticker_emoticons_angry:"Angry",imgly_sticker_emoticons_anxious:"Anxious",imgly_sticker_emoticons_asleep:"Asleep",imgly_sticker_emoticons_attention:"Attention",imgly_sticker_emoticons_baby_chicken:"Baby Chicken",imgly_sticker_emoticons_batman:"Batman",imgly_sticker_emoticons_beer:"Beer",imgly_sticker_emoticons_black:"Black",imgly_sticker_emoticons_blue:"Blue",imgly_sticker_emoticons_blush:"Blush",imgly_sticker_emoticons_boxer:"Boxer",imgly_sticker_emoticons_business:"Business",imgly_sticker_emoticons_chicken:"Chicken",imgly_sticker_emoticons_cool:"Cool",imgly_sticker_emoticons_cry:"Cry",imgly_sticker_emoticons_deceased:"Deceased",imgly_sticker_emoticons_devil:"Devil",imgly_sticker_emoticons_duckface:"Duckface",imgly_sticker_emoticons_furious:"Furious",imgly_sticker_emoticons_grin:"Grin",imgly_sticker_emoticons_guitar:"Guitar",imgly_sticker_emoticons_harry_potter:"Harry Potter",imgly_sticker_emoticons_hippie:"Hippie",imgly_sticker_emoticons_hitman:"Hitman",imgly_sticker_emoticons_humourous:"Humourous",imgly_sticker_emoticons_idea:"Idea",imgly_sticker_emoticons_impatient:"Impatient",imgly_sticker_emoticons_kiss:"Kiss",imgly_sticker_emoticons_kisses:"Kisses",imgly_sticker_emoticons_laugh:"Laugh",imgly_sticker_emoticons_loud_cry:"Loud Cry",imgly_sticker_emoticons_loving:"Loving",imgly_sticker_emoticons_masked:"Masked",imgly_sticker_emoticons_music:"Music",imgly_sticker_emoticons_nerd:"Nerd",imgly_sticker_emoticons_ninja:"Ninja",imgly_sticker_emoticons_not_speaking_to_you:"Not speaking to you",imgly_sticker_emoticons_pig:"Pig",imgly_sticker_emoticons_pumpkin:"Pumpkin",imgly_sticker_emoticons_question:"Question",imgly_sticker_emoticons_rabbit:"Rabbit",imgly_sticker_emoticons_sad:"Sad",imgly_sticker_emoticons_sick:"Sick",imgly_sticker_emoticons_skateboard:"Skateboard",imgly_sticker_emoticons_skull:"Skull",imgly_sticker_emoticons_sleepy:"Sleepy",imgly_sticker_emoticons_smile:"Smile",imgly_sticker_emoticons_smoking:"Smoking",imgly_sticker_emoticons_sobbing:"Sobbing",imgly_sticker_emoticons_star:"Star",imgly_sticker_emoticons_steaming_furious:"Steaming Furious",imgly_sticker_emoticons_sunbathing:"Sunbathing",imgly_sticker_emoticons_tired:"Tired",imgly_sticker_emoticons_tongue_out_wink:"Tongue out wink",imgly_sticker_emoticons_wave:"Wave",imgly_sticker_emoticons_wide_grin:"Wide Grin",imgly_sticker_emoticons_wink:"Wink",imgly_sticker_emoticons_wrestler:"Wrestler",imgly_sticker_shapes:"Shapes",imgly_sticker_shapes_arrow_02:"Arrow 1",imgly_sticker_shapes_arrow_03:"Arrow 2",imgly_sticker_shapes_badge_01:"Badge 1",imgly_sticker_shapes_badge_11:"Badge 5",imgly_sticker_shapes_badge_12:"Badge 6",imgly_sticker_shapes_badge_13:"Badge 7",imgly_sticker_shapes_badge_15:"Badge 8",imgly_sticker_shapes_badge_18:"Badge 9",imgly_sticker_shapes_badge_19:"Badge 10",imgly_sticker_shapes_badge_20:"Badge 11",imgly_sticker_shapes_badge_28:"Badge 12",imgly_sticker_shapes_badge_32:"Badge 13",imgly_sticker_shapes_badge_35:"Badge 14",imgly_sticker_shapes_badge_36:"Badge 15",imgly_sticker_shapes_badge_04:"Badge 2",imgly_sticker_shapes_badge_06:"Badge 3",imgly_sticker_shapes_badge_08:"Badge 4",imgly_sticker_shapes_spray_01:"Spray 1",imgly_sticker_shapes_spray_03:"Spray 2",imgly_sticker_shapes_spray_04:"Spray 3"}},brush:{title:{name:"Brush",width:"Width",hardness:"Hardness",settings:"Brush Settings"}},frame:{title:{name:"Frames",opacity:"Opacity",width:"Width"},button:{fill:"Fill",replace:"Replace",none:"None"},asset:{imgly_frame_dia:"Dia",imgly_frame_art_decor:"Art Decor",imgly_frame_black_passepartout:"Black Passepartout",imgly_frame_lowpoly_shadow:"Low Poly",imgly_frame_wood_passepartout:"Wood Passepartout"}},artfilter:{title:{name:"Art Filters"},asset:{none:"None",imgly_art_filter_june_tree:"Natasha Wescoat",imgly_art_filter_hive:"Hive",imgly_art_filter_udnie:"Udnie",imgly_art_filter_vince_low:"Vince Low",imgly_art_filter_mosaic:"Mosaic",imgly_art_filter_wave:"Wave",imgly_art_filter_watercolor:"Malikova Darya"}},overlay:{title:{name:"Overlays",blending:"Blending",none:"None",normal:"Normal",overlay:"Overlay",hardLight:"Hard Light",softLight:"Soft Light",multiply:"Multiply",darken:"Darken",lighten:"Lighten",screen:"Screen",colorBurn:"Color Burn"},button:{none:"None"},asset:{imgly_overlay_bokeh:"Bokeh",imgly_overlay_chop:"Chop",imgly_overlay_clouds:"Clouds",imgly_overlay_golden:"Golden",imgly_overlay_grain:"Grain",imgly_overlay_hearts:"Hearts",imgly_overlay_lightleak1:"Light Leak 1",imgly_overlay_lightleak2:"Light Leak 2",imgly_overlay_metal:"Metal",imgly_overlay_mosaic:"Mosaic",imgly_overlay_painting:"Painting",imgly_overlay_paper:"Paper",imgly_overlay_rain:"Rain",imgly_overlay_vintage:"Vintage",imgly_overlay_wall1:"Wall",imgly_overlay_wall2:"Wall 2",imgly_overlay_wood:"Wood"}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),r=n.n(i),o=n(324),a=n(335),s=n(338),l=n(347),c=n(150),u=n(359),f=n(364),p=n(368),d=n(375),h=n(380),_=n(386),m=n(389),g=[o.a,a.a,s.a,l.a,c.a,u.a,f.a,p.a,d.a,h.a,_.a,m.a];r.a.AllControls=g,t.default=g},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=n.n(d),_=n(325),m=n(331),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.BaseControls),g(t,[{key:"shouldKeepChanges",value:function(){var e=this,t=this.context,n=t.editor,i=t.ui;return void 0===this.keepChanges&&!n.isShallow&&n.history.isUndoAvailable()?new u.a(function(t,n){d.ModalManager.instance.displayWarning(i.translate("pesdk.editor.title.discardChangesWarning"),i.translate("pesdk.editor.text.discardChangesWarning"),[i.translate("pesdk.editor.button.discardChangesWarningKeep"),i.translate("pesdk.editor.button.discardChangesWarningDiscard")],!0).on("button",function(n){var i=0===n;e.keepChanges=i,t(i)})}):u.a.resolve(this.keepChanges)}},{key:"onImage",value:function(e){var t=this;this.shouldKeepChanges().then(function(n){t._options.switchScreenOnImage?(t.context.options.editor.image=e,t.context.appComponent.switchToScreen("editor")):t.context.editor.setImage(e,!n),t.sharedState.get("webcamEnabled")&&(t.sharedState.set({webcamEnabled:!1}),t.context.options.editor.forceCrop||t.context.screen.switchToControls("default"))})}},{key:"_onEnter",value:function(){this.sharedState.set({webcamEnabled:!1})}}],[{key:"hasLibraryProvider",value:function(e){var t=e.getOptions().editor.controlsOptions;if(void 0===t.library)return!0;var n=t.library;return!!(n.provider||n.enableWebcam||n.enableUpload)}},{key:"isEnabled",value:function(e){return t.hasLibraryProvider(e)&&e.isToolEnabled("library")}}]),t}();y.clickAtPosition=d.BaseControls.clickAtPosition,y.getPreloadAssets=d.BaseControls.getPreloadAssets,y.identifier="library",y.controlsComponent=_.a,y.canvasControlsComponent=m.a,y.iconPath="editor/controls/library/icon.png",y.activeIconPath="editor/controls/library/icon-active.png",y.defaultOptions={enableWebcam:!0,enableUpload:!0,displayUploadInCanvas:!1,switchScreenOnImage:!1},h.a.Controls.LibraryControls=y,t.a=y},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(326)),_=n(328),m=n(330),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y={ROOT:0,SEARCH:1},v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i))),a=o.props.options.provider;return a&&(o._library=new a),o._bindAll("_onCategorySelect","_onImageSelect","_onSearchQueryChange","_onWebcamActivated"),o.state.currentPanel=y.ROOT,o.state.searchQuery="",o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),g(t,[{key:"_onBackButtonClick",value:function(e){this.setState({currentPanel:y.ROOT,searchQuery:"",backButton:!1}),e.preventDefault()}},{key:"_onCategorySelect",value:function(e){this.setState({currentPanel:y.SEARCH,searchQuery:e.getName(),backButton:!0})}},{key:"_onImageSelect",value:function(e){var t=this;this.setSharedState({webcamEnabled:!1});var n=new window.Image,i=void 0,r=setTimeout(function(){i=d.ModalManager.instance.displayLoading(t._t("pesdk.common.text.loading"))},200);n.addEventListener("load",function(){i&&i.close(),r&&(clearTimeout(r),r=null),t.props.controls.onImage(n)}),n.addEventListener("error",function(){i&&i.close(),r&&(clearTimeout(r),r=null),d.ModalManager.instance.displayError(t._t("pesdk.common.title.error"),t._t("pesdk.editor.text.imageLoadingError"))}),n.crossOrigin=this.context.editor.getCrossOrigin(),n.src=e.getRawUrl()}},{key:"_onSearchQueryChange",value:function(e){this.setState({searchQuery:e,currentPanel:y.SEARCH})}},{key:"_onWebcamActivated",value:function(e){this.setSharedState({webcamEnabled:!0})}},{key:"fixStyles",value:function(){var e=this;if(this._list)return this._list.style.height="100%",function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"fixStyles",this).call(this).then(function(){if(d.Utils.Browser.isIElte(10)){var t=e._container.offsetHeight;e._list.style.height=t+"px"}return e.refs.panel.fixStyles()})}},{key:"_renderCurrentPanel",value:function(){var e=this;switch(this.state.currentPanel){case y.ROOT:return d.React.createElement(h.a,{controls:this.props.controls,innerRef:function(t){e._list=t},library:this._library,onCategorySelect:this._onCategorySelect,onWebcamActivated:this._onWebcamActivated,options:this.props.options,key:"panel",ref:"panel"});case y.SEARCH:return d.React.createElement(_.a,{innerRef:function(t){e._list=t},library:this._library,onImageSelect:this._onImageSelect,searchQuery:this.state.searchQuery,key:"panel",ref:"panel"})}}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!1}}},{key:"_renderContent",value:function(){var e=[];return this._library&&e.push(d.React.createElement(m.a,{key:"searchHeader",onChange:this._onSearchQueryChange,searchQuery:this.state.searchQuery})),e.push(this._renderCurrentPanel()),e}}]),t}();v.contextTypes=d.ControlsComponent.contextTypes,v.propTypes=d.ControlsComponent.propTypes,v.RootElement=d.ControlsComponent.RootElement,t.a=v},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(5),m=(n.n(_),n(327)),g=n(149),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onImage"),o.state={loading:!0,categories:[]},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.BaseComponent),y(t,[{key:"fixStyles",value:function(){var e=this;return p.a.resolve().then(function(){_.Utils.Browser.isIElte(10)?Object(_.requestAnimationFrame)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"componentDidMount",value:function(){v(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this._loadCategories()}},{key:"componentWillUnmount",value:function(){v(t.prototype.__proto__||h()(t.prototype),"componentWillUnmount",this).call(this),this._loadCoverImagesQueue&&this._loadCoverImagesQueue.dispose(),this._disposed=!0}},{key:"_onCategoryClick",value:function(e){this.props.onCategorySelect&&this.props.onCategorySelect(e)}},{key:"_onImage",value:function(e){this.props.controls.onImage(e)}},{key:"_loadCoverImages",value:function(e){var t=this,n=this.context,i=n.theme,r=n.options,o=e.map(function(e){return{fn:function(){return e.loadCoverImage(r.crossOrigin)},index:e}});this._loadCoverImagesQueue=new _.DelayedJobQueue(o,{minDelay:i.listItemSlideInDelay}),this._loadCoverImagesQueue.on("job-done",function(e){t._disposed||(t.forceUpdate(),t._scrollbar.update())}),this._loadCoverImagesQueue.start()}},{key:"_loadCategories",value:function(){var e=this;return this.props.library?this.props.library.getCategories().then(function(t){e._loadCoverImages(t),e.setState({loading:!1,categories:t})}):(this.setState({loading:!1,categories:[]}),p.a.resolve())}},{key:"_renderListItems",value:function(){var e=this;return this.state.categories.map(function(t){return _.React.createElement(m.a,{key:t.getName(),category:t,visible:t.isCoverImageLoaded(),onClick:e._onCategoryClick.bind(e,t)})})}},{key:"render",value:function(){var e=this,t=this.props.options,n=t.enableUpload,i=t.displayUploadInCanvas,r=this.props.innerRef;return _.React.createElement(k,{innerRef:function(t){r&&r(t),e._wrapper=t},className:void 0},_.React.createElement(_.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},_.React.createElement(w,null,n&&!i&&_.React.createElement(g.a,{controls:this.props.controls,onImage:this._onImage,webcamEnabled:this.props.options.enableWebcam,onWebcamActivated:this.props.onWebcamActivated}),this.state.loading?_.React.createElement(_.LoadingIndicatorComponent,null):this._renderListItems())))}}]),t}();t.a=b;var k=_.adonis.div("rfecls","RootPanelWrapper"),w=_.adonis.ul("5jg0ou","CategoryList")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.ControlItem,h=f.ControlsStyles.ControlItemTitle,_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"render",value:function(){var e=this.props,t=e.category,n=e.onClick,i=e.visible,r={backgroundImage:"url('"+t.getCoverImage()+"')"};return f.React.createElement(m,{animated:!0,style:r,visible:i,className:void 0,onClick:n},f.React.createElement(g,null,t.getName()))}}]),t}();t.a=_;var m=Object(f.adonis)(d).li("prcvvt","ListItem"),g=Object(f.adonis)(h).div("1ler8h7","ListItemTitle")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(8),p=n.n(f),d=n(1),h=n.n(d),_=n(5),m=(n.n(_),n(329)),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o.state={loading:!0,images:[]},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.BaseComponent),g(t,[{key:"fixStyles",value:function(){var e=this;return p.a.resolve().then(function(){_.Utils.Browser.isIElte(10)?Object(_.requestAnimationFrame)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"componentDidMount",value:function(){y(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this._loadImages(this.props.searchQuery)}},{key:"componentWillReceiveProps",value:function(e){this.props.searchQuery!==e.searchQuery&&this._loadImages(e.searchQuery)}},{key:"componentWillUnmount",value:function(){y(t.prototype.__proto__||h()(t.prototype),"componentWillUnmount",this).call(this),this._loadThumbsQueue.stop(),this._loadThumbsQueue.dispose(),this._disposed=!0}},{key:"_onImageClick",value:function(e){this.props.onImageSelect&&this.props.onImageSelect(e)}},{key:"_loadThumbs",value:function(e){var t=this,n=this.context,i=n.theme,r=n.options,o=e.map(function(e){return{fn:function(){return e.loadThumb(r.crossOrigin)},index:e}});this._loadThumbsQueue=new _.DelayedJobQueue(o,{minDelay:i.listItemSlideInDelay}),this._loadThumbsQueue.on("job-done",function(e){t._disposed||(t.forceUpdate(),t._scrollbar&&t._scrollbar.update())}),this._loadThumbsQueue.start()}},{key:"_loadImages",value:function(e){var t=this;return e.trim()||this.setState({loading:!1,images:[]},function(){return t._scrollbar&&t._scrollbar.update()}),this.setState({loading:!0}),this.props.library.searchImages(e).then(function(e){t._loadThumbs(e),t.setState({loading:!1,images:e},function(){return t._scrollbar.update()})})}},{key:"_renderListItems",value:function(){var e=this,t=this.context.editor.getImage();return 0===this.state.images.length?_.React.createElement(w,null,this._t("pesdk.library.text.noResults")):this.state.images.map(function(n){return _.React.createElement(m.a,{key:n.getThumbUrl(),image:n,selected:n.getRawUrl()===(t&&t.src),visible:n.isThumbLoaded(),onClick:e._onImageClick.bind(e,n)})})}},{key:"render",value:function(){var e=this;if(this.state.loading)return _.React.createElement(_.LoadingIndicatorComponent,null);var t=this.props.innerRef;return _.React.createElement(b,{innerRef:function(n){t&&t(n),e._wrapper=n},className:void 0},_.React.createElement(_.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},_.React.createElement(k,null,this._renderListItems())))}}]),t}();t.a=v;var b=_.adonis.div("rfecls","RootPanelWrapper"),k=_.adonis.ul("5jg0ou","ImageList"),w=_.adonis.div("6kl290","NoResultsText")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.ControlItem,h=f.ControlsStyles.ControlItemActiveOverlay,_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o.state={isPortrait:!1,hovered:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"componentWillReceiveProps",value:function(e){if(this.props.visible!==e.visible){var t=this.props.image.getThumbImage();t.height>t.width&&this.setState({isPortrait:!0})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.image,i=t.onClick,r=t.selected,o=t.visible,a={backgroundImage:"url('"+n.getThumbUrl()+"')"},s=n.getAuthorAvatar(),l=this.context.theme.transitionDuration,c=[void 0,r&&"is-selected"].filter(function(e){return e});return f.React.createElement(m,{animated:!0,style:a,selected:r,visible:o,className:c.join(" "),onClick:i,portrait:this.state.isPortrait,onMouseEnter:function(){return e.setState({hovered:!0})},onMouseLeave:function(){return e.setState({hovered:!1})}},f.React.createElement(f.Transition,{active:this.state.hovered,enterProp:"rendered",enterDuration:1e3*l,appearProp:"visible",appearDuration:1e3*l,leaveDuration:1e3*l},f.React.createElement(b,{selected:r},s&&f.React.createElement(y,{src:s}),f.React.createElement(v,null,n.getAuthorName()))),f.React.createElement(f.Transition,{active:r,enterProp:"rendered",enterDuration:1e3*l,appearProp:"visible",appearDuration:1e3*l,leaveDuration:1e3*l},f.React.createElement(g,{selected:!0})))}}]),t}();t.a=_;var m=Object(f.adonis)(d).li("1a5mxw5",{portrait:"otbyv0"},"ListItem"),g=Object(f.adonis)(h).div("120drhm","ListItemOverlay"),y=f.adonis.img("1owxkzt","AuthorAvatar"),v=f.adonis.div("1jylqsv","AuthorName"),b=f.adonis.div("mchu36",{rendered:"2jlos",visible:"1fmxelx"},"Author")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=250,h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onInputChange"),o._onDebouncedInputChange=f.Utils.debounce(o._onDebouncedInputChange,d),o.state={searchQueryInputValue:""},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"componentWillReceiveProps",value:function(e){this.props.searchQuery!==e.searchQuery&&this.setState({searchQueryInputValue:e.searchQuery})}},{key:"componentWillUnmount",value:function(){this._disposed=!0}},{key:"_onDebouncedInputChange",value:function(e){this._disposed||this.props.onChange&&this.props.onChange(e)}},{key:"_onInputChange",value:function(e){var t=e.target.value;this.setState({searchQueryInputValue:t}),this._onDebouncedInputChange(t)}},{key:"render",value:function(){return f.React.createElement(_,{key:"header"},f.React.createElement(m,null,f.React.createElement(g,{placeholder:this._t("pesdk.library.placeholder.search"),onLiveChange:this._onInputChange,className:void 0,value:this.state.searchQueryInputValue})))}}]),t}();t.a=h;var _=f.adonis.div("1tkmkv6","Header"),m=f.adonis.div("mz0a5q","InputContainer"),g=Object(f.adonis)(f.TextInputComponent)("py3uvl","TextInput")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(332)),_=n(334),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onImage","_onWebcamBack","_onWebcamActivated"),o.state.displayHeader=!0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.CanvasControlsComponent),m(t,[{key:"_onImage",value:function(e){this.props.controls.onImage(e)}},{key:"_onWebcamBack",value:function(){this.setSharedState({webcamEnabled:!1})}},{key:"_onWebcamActivated",value:function(e){this.setSharedState({webcamEnabled:!0})}},{key:"_renderControls",value:function(){var e=this.getSharedState("webcamEnabled"),n=this.props.options.displayUploadInCanvas;return e?d.React.createElement(h.a,{onImage:this._onImage,onBack:this._onWebcamBack}):n?d.React.createElement(y,null,d.React.createElement(_.a,{large:!0,controls:this.props.controls,webcamEnabled:this.props.options.enableWebcam,onWebcamActivated:this._onWebcamActivated,onImage:this._onImage})):function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_renderControls",this).call(this)}}]),t}();g.contextTypes=d.CanvasControlsComponent.contextTypes,t.a=g;var y=d.adonis.div("1up9ikz","LibraryUploadContainer")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=(n.n(f),n(5)),d=(n.n(p),n(333)),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onWebcamReady","_onWebcamError","_onButtonClick","_onCancelClick"),o.state={webcamReady:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.BaseComponent),h(t,[{key:"_onWebcamReady",value:function(){this.props.onReady&&this.props.onReady(),this.setState({webcamReady:!0})}},{key:"_onWebcamError",value:function(e){var t=this;p.ModalManager.instance.displayError(this._t("pesdk.common.title.error"),this._t("pesdk.editor.text.webcamUnavailableError",{error:e})).on("close",function(){return t.props.onBack()})}},{key:"_onButtonClick",value:function(e){e.preventDefault(),this._takePhoto()}},{key:"_onCancelClick",value:function(e){e.preventDefault(),this.props.onBack&&this.props.onBack()}},{key:"_takePhoto",value:function(){var e=this;this.state.webcamReady&&this._webcam.capture().then(function(t){e.props.onImage&&e.props.onImage(t)})}},{key:"render",value:function(){var e=this;return p.React.createElement(m,null,p.React.createElement(g,null,p.React.createElement(y,{onClick:this._onCancelClick},this._t("pesdk.common.button.cancel"))),p.React.createElement(v,null,p.React.createElement(b,{innerRef:function(t){e._videoContainer=t}},p.React.createElement(d.a,{flashURL:this._getAssetPath("fallback/webcam.swf"),ref:function(t){e._webcam=t},onWebcamError:this._onWebcamError,onWebcamAvailable:this._onWebcamReady}),p.React.createElement(k,{onClick:this._onButtonClick}))))}}]),t}();t.a=_;var m=p.adonis.div("154zhv1","Container"),g=p.adonis.div("4d756t","Gradient"),y=p.adonis.div("1p4kwwq","CancelButton"),v=p.adonis.div("1kcrztx","OuterVideoContainer"),b=p.adonis.div("12pjfqx","VideoContainer"),k=p.adonis.div("1fkab7z","Button")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(24),h=n.n(d),_=n(39),m=n.n(_),g=n(5),y=(n.n(g),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),v=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).call(this,e));return n._bindAll("_onLoadedMetadata"),n.state={webcamAvailable:!1,useFlashFallback:!1},n._getUserMedia=null,n._webcamStream=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,g.BaseComponent),y(t,[{key:"componentDidMount",value:function(){var e=this;if(this._initGetUserMedia(),this._getUserMedia)this._getUserMedia({video:{optional:[{minWidth:320},{minWidth:640},{minWidth:1024},{minWidth:1280},{minWidth:1920},{minWidth:2560}]},audio:!1}).then(function(t){e._webcamStream=t;var n=e._videoElement;"srcObject"in n?n.srcObject=t:n.src=window.URL.createObjectURL(t)}).catch(function(t){e.props.onWebcamError&&e.props.onWebcamError(t)});else{var t=!1;window.Webcam||(window.Webcam={},t=!0),window.Webcam.flashNotify=function(n,i){switch(n){case"cameraLive":e.setState({webcamAvailable:!0},function(){e.props.onWebcamAvailable&&e.props.onWebcamAvailable()}),delete window.Webcam.flashNotify,t&&delete window.Webcam;break;case"error":e.props.onWebcamError&&e.props.onWebcamError(i),delete window.Webcam.flashNotify,t&&delete window.Webcam}}}}},{key:"componentWillUnmount",value:function(){this._disposeWebcam()}},{key:"_initGetUserMedia",value:function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia&&(this._getUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices)),!this._getUserMedia){var e=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;e&&(this._getUserMedia=function(t){return new u.a(function(n,i){return e.call(navigator,t,n,i)})})}this._getUserMedia||this.setState({useFlashFallback:!0})}},{key:"_disposeWebcam",value:function(){if(this._webcamStream){var e=this._webcamStream,t=e.getTracks()[0];t?t.stop():e.stop&&e.stop()}else this._flashWebcam&&this._flashWebcam._releaseCamera()}},{key:"capture",value:function(){var e=this;return this.state.webcamAvailable?this._videoElement&&!this._flashWebcam?new u.a(function(t,n){var i=e._videoElement;if(0===i.readyState)n(new Error("Webcam video not available"));else{var r=document.createElement("canvas");r.width=i.videoWidth,r.height=i.videoHeight,r.getContext("2d").drawImage(i,0,0);var o=new window.Image;o.addEventListener("load",function(){t(o)}),o.src=r.toDataURL("image/jpeg")}}):this._flashWebcam?new u.a(function(t,n){var i=e._flashWebcam._snap(),r=new Image;r.onload=function(){t(r)},r.src="data:image/jpeg;base64,"+i}):u.a.reject(new Error("Webcam video not available")):u.a.reject(new Error("Webcam video not available"))}},{key:"_getFlashFallbackComponent",value:function(){var e=this,t=this._container,n=t.offsetWidth,i=t.offsetHeight,r=640,o=480;i>n?(r=n||640,o=.75*n):(r=4/3*i,o=i||480);var a="width="+r+"&height="+o+"&dest_width=1024&dest_height=768&jpeg_quality=100&fps=24";return m.a.createElement("object",{classID:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",type:"application/x-shockwave-flash",width:r,height:o,ref:function(t){e._flashWebcam=t},align:"middle"},m.a.createElement("param",{name:"wmode",value:"transparent"}),m.a.createElement("param",{name:"allowScriptAccess",value:"always"}),m.a.createElement("param",{name:"allowFullScreen",value:"false"}),m.a.createElement("param",{name:"movie",value:this.props.flashURL}),m.a.createElement("param",{name:"loop",value:"false"}),m.a.createElement("param",{name:"menu",value:"false"}),m.a.createElement("param",{name:"quality",value:"best"}),m.a.createElement("param",{name:"bgcolor",value:"#ffffff"}),m.a.createElement("param",{name:"flashvars",value:a}))}},{key:"_onLoadedMetadata",value:function(){var e=this;this.setState({webcamAvailable:!0},function(){e.props.onWebcamAvailable&&e.props.onWebcamAvailable()})}},{key:"render",value:function(){var e=this,t=this.state.useFlashFallback?this._getFlashFallbackComponent():m.a.createElement(b,{autoPlay:!0,visible:this.state.webcamAvailable&&!this.state.useFlashFallback,innerRef:function(t){e._videoElement=t},onLoadedMetadata:this._onLoadedMetadata});return m.a.createElement("div",{style:{width:"100%",height:"100%",overflow:"hidden"},ref:function(t){e._container=t}},t)}}]),t}();v.propTypes={flashURL:h.a.string,onWebcamAvailable:h.a.func,onWebcamError:h.a.func},t.a=v;var b=g.adonis.video("2iod8f",{visible:"jsuk9w"},"Video")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),n(149)),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=f.ControlsStyles.PlainControlItem,_=f.ControlsStyles.PlainControlItemBackground,m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.a),d(t,[{key:"render",value:function(){var e={backgroundImage:"url('"+this._getAssetPath("editor/controls/library/webcam.png",!0)+"')"};return f.React.createElement(g,null,f.React.createElement(y,null,f.React.createElement(k,null,f.React.createElement(v,{onClick:this._onDropZoneClick,onDragEnter:this._onDropZoneDragEnter,onDragOver:this._onDropZoneDragOver,onDragLeave:this._onDropZoneDragLeave,onDrop:this._onDropZoneDrop,hovered:this.state.dropZoneHovered},f.React.createElement(f.InvisibleUploadComponent,{ref:"upload",onNewFile:this._onNewFile}),this.state.dropZoneHovered?this._t("pesdk.library.button.fileDropZoneHovered"):this._t("pesdk.library.button.fileDropZone"))),!this.state.dropZoneHovered&&this.props.webcamEnabled&&f.React.createElement(k,null,f.React.createElement(b,{style:e,className:void 0,onClick:this._onWebcamClick}))))}}]),t}();t.a=m;var g=Object(f.adonis)(h).div("1xesje3","Container"),y=Object(f.adonis)(_).div("z914p5","Background"),v=f.adonis.div("yw0i2r",{hovered:"1xndhux"},"DropZone"),b=f.adonis.div("1jg5y1q","WebcamButton"),k=f.adonis.div("15u7gri","Row")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=n.n(f),d=n(336),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseControls),h(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=e.getOrCreate("adjustments");return{brightness:t.getBrightness(),saturation:t.getSaturation(),contrast:t.getContrast(),gamma:t.getGamma(),exposure:t.getExposure(),shadows:t.getShadows(),highlights:t.getHighlights(),clarity:t.getClarity(),whites:t.getWhites(),blacks:t.getBlacks(),temperature:t.getTemperature(),sharpness:t.getSharpness(),setBrightness:function(e){t.setBrightness(e)},setSaturation:function(e){t.setSaturation(e)},setContrast:function(e){t.setContrast(e)},setGamma:function(e){t.setGamma(e)},setExposure:function(e){t.setExposure(e)},setShadow:function(e){t.setShadow(e)},setHighlights:function(e){t.setHighlights(e)},setClarity:function(e){t.setClarity(e)},setWhites:function(e){t.setWhites(e)},setBlacks:function(e){t.setBlacks(e)},setTemperature:function(e){t.setTemperature(e)},setSharpness:function(e){t.setSharpness(e)},reset:function(){t.resetOptions()},setOperationOptions:function(e){t.set(e)}}}}],[{key:"isEnabled",value:function(e){return e.isToolAllowed("adjustment")&&e.isToolEnabled("adjustments")}}]),t}();_.clickAtPosition=f.BaseControls.clickAtPosition,_.getPreloadAssets=f.BaseControls.getPreloadAssets,_.identifier="adjustments",_.controlsComponent=d.a,_.canvasControlsComponent=f.BaseControls.canvasControlsComponent,_.iconPath="editor/controls/adjustments/icon.png",_.activeIconPath="editor/controls/adjustments/icon-active.png",_.requiredOperations=["adjustments"],_.defaultOptions={availableAdjustments:null},_.updatableOperations=["adjustments"],_.switchToDefaultControlsOnRemoval=!1,_.SECTIONS=[{identifier:"basics",items:["brightness","saturation","contrast","gamma"]},{identifier:"refinements",items:["clarity","exposure","shadows","highlights","whites","blacks","temperature","sharpness"]}],p.a.Controls.AdjustmentsControls=_,t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),n(337)),d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=f.GroupedControlsStyles.ControlGroupList,_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onResetDefaultClick"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.ControlsComponent),d(t,[{key:"_isAdjustmentAvailable",value:function(e){var t=this.props.options.availableAdjustments;return null===t||-1!==t.indexOf(e)}},{key:"_onResetDefaultClick",value:function(e){this.sharedState.reset(),this.props.controls.addLocalHistorySnapshot("reset",!0),e.preventDefault()}},{key:"_onValueChange",value:function(e,t){this.sharedState.setOperationOptions(function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t)),this.props.controls.addLocalHistorySnapshot(e,!0)}},{key:"_renderAdjustmentsControls",value:function(){var e=this,t=function(t){return t.filter(function(t){return e._isAdjustmentAvailable(t)}).map(function(t){return e._makeItem(t)})};return this.props.controls.constructor.SECTIONS.filter(function(t){return t.items.filter(function(t){return e._isAdjustmentAvailable(t)}).length>0}).map(function(n){return f.React.createElement(f.CollapseSectionComponent,{key:n.identifier,title:e._t("pesdk.adjustments.title."+n.identifier),alwaysExpanded:!0},f.React.createElement(g,{className:void 0+n.identifier},t(n.items)))})}},{key:"_makeItem",value:function(e){var t=this.sharedState[e];return f.React.createElement(p.a,{item:e,value:t,onValueChange:this._onValueChange.bind(this,e),className:void 0,key:e})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this;return f.React.createElement(f.ScrollableListComponent,{direction:"vertical",innerListRef:function(t){e._list=t},innerRef:function(t){e._scrollbar=t}},f.React.createElement(m,null,f.React.createElement(y,null,f.React.createElement(f.ButtonComponent,{title:this._t("pesdk.adjustments.button.reset"),className:void 0,onClick:this._onResetDefaultClick})),this._renderAdjustmentsControls()))}}]),t}();_.contextTypes=f.ControlsComponent.contextTypes,_.RootElement=f.ControlsComponent.RootElement,t.a=_;var m=Object(f.adonis)(h).ul("x32ss4","SectionList"),g=f.adonis.ul("gz4y54","SectionItemList"),y=f.adonis.div("7abnmv","BottomSection")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=n.n(f),d=n(5),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),_=p.a.Operations.AdjustmentsOperation,m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onValueChange"),o._option=_.prototype.availableOptions[o.props.item],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),h(t,[{key:"shouldComponentUpdate",value:function(e){return e.value!==this.props.value}},{key:"_onValueChange",value:function(e){var t=this._option,n=t.minValue,i=t.midValue,r=t.maxValue;e=e<0?i+(i-n)*e/100:i+(r-i)*e/100,this.props.onBeforeValueChange&&this.props.onBeforeValueChange(e),this.context.editor.render(),this.setState({value:e}),this.props.onValueChange&&this.props.onValueChange(e)}},{key:"render",value:function(){var e=this._option,t=e.minValue,n=e.midValue,i=e.maxValue,r=this.props.value,o=100*(r<=n?(r-t)/(n-t)-1:(r-n)/(i-n));return r===t&&(o=-100),d.React.createElement(d.SliderControlComponent,{key:this.props.item,label:this._t("pesdk.adjustments.text."+this.props.item),minValue:-100,maxValue:100,value:parseInt(o),onSliderValueChange:this._onValueChange,onValueChange:this._onValueChange,className:this.props.className,middleDot:!0})}}]),t}();m.contextTypes=d.SharedStateComponent.contextTypes,t.a=m},function(e,t,n){"use strict";var i=n(20),r=n.n(i),o=n(9),a=n.n(o),s=n(0),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(7),m=(n.n(_),n(5)),g=n.n(m),y=n(339),v=n(341),b=a.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),l()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=(_.Operations.SpriteOperation?_.Operations.SpriteOperation:{}).BrushSprite,S=function(e){function t(e,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).call(this,e,n,i));return r._onOperationRemoved=r._onOperationRemoved.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,m.BaseControls),k(t,[{key:"mapOperationsToSharedState",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],{operation:e.getOrCreate("sprite")}}},{key:"_onEnter",value:function(){var e=this,t=this.context.editor,n=t.operations.getOrCreate("sprite"),i=n.createBrush();n.addSprite(i);var r=this.getGlobalToolState(),o=r||{brushColor:_.Color.WHITE,brushSize:.1,brushHardness:50};t.zoom.auto(!1,!1,function(){t.features.disable("zoom","drag");var n=t.getOutputDimensions(),i=Math.max(.05*n.min(),1);e._options.widthPresets&&e._options.widthPresets.length>0&&(i=e._options.sizePresets[0]),e.sharedState.set({brushSize:r?r.brushSize:Math.round(i)})}),this.sharedState.set(b({},o,{operation:n,brushSprite:i}))}},{key:"_onLeave",value:function(){var e=this.context.editor,t=e.operations.get("sprite");t&&[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return r()(e)}(t.getSprites())).forEach(function(e){e instanceof w&&e.getPaths().length<=0&&t.removeSprite(e)}),this.saveBrushSettings(),e.features.enable("zoom","drag"),e.render()}},{key:"_onOperationRemoved",value:function(e){if(e===this.sharedState.get("operation")){var t=this.context.editor.operations.getOrCreate("sprite"),n=t.createBrush();t.addSprite(n),this.sharedState.set({operation:t,brushSprite:n})}}},{key:"saveBrushSettings",value:function(){this.setGlobalToolState({brushColor:this.sharedState.get("brushColor"),brushSize:this.sharedState.get("brushSize"),brushHardness:this.sharedState.get("brushHardness")})}}],[{key:"isEnabled",value:function(e){return e.isToolAllowed("brush")&&e.isToolEnabled("brush")}}]),t}();S.clickAtPosition=m.BaseControls.clickAtPosition,S.getPreloadAssets=m.BaseControls.getPreloadAssets,S.identifier="brush",S.controlsComponent=y.a,S.canvasControlsComponent=v.a,S.iconPath="editor/controls/brush/icon.png",S.activeIconPath="editor/controls/brush/icon-active.png",S.requiredOperations=["sprite"],S.defaultOptions={brushes:[],replaceBrushes:!1,availableBrushes:null},S.updatableOperations=["sprite"],S.switchToDefaultControlsOnRemoval=!1,g.a.Controls.BrushControls=S,t.a=S},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=d()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(f.a?f()(e,t):e.__proto__=t)}var a=n(0),s=n.n(a),l=n(6),c=n.n(l),u=n(2),f=n.n(u),p=n(3),d=n.n(p),h=n(8),_=n.n(h),m=n(1),g=n.n(m),y=n(7),v=(n.n(y),n(5)),b=(n.n(v),n(340)),k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=void 0;y.Operations.SpriteOperation&&(w=y.Operations.SpriteOperation.BrushSprite.Brush);var S=v.GroupedControlsStyles.ControlGroupTitle,C=v.GroupedControlsStyles.ControlGroup,E=function(e){function t(){var e;i(this,t);for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=r(this,(e=t.__proto__||g()(t)).call.apply(e,[this].concat(o)));l._bindAll("_onBrushColorChanged","_onBrushHardnessChanged","_onBrushWidthChanged","_onOperationUpdated"),l._events=function(e,t,n){return t in e?s()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},v.Constants.EVENTS.OPERATION_UPDATED,l._onOperationUpdated),l._initBrushManager();var c=null,u=o[0].controls._options;return u&&u.colors&&(c=u.colors),l.state={colorPalette:c},l}return o(t,v.ControlsComponent),k(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=c()(t,n);if(void 0===r){var o=g()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||g()(t.prototype),"componentDidMount",this).call(this),this._onBrushSelect(this._brushManager.getBrushes()[0])}},{key:"_initBrushManager",value:function(){this._brushManager=new v.BrushManager(this.context.ui,this.props.options)}},{key:"_onBrushColorChanged",value:function(e){var t=this.getSharedState("brushInstance").clone();t.setColor(e.clone()),this.setSharedState({brushInstance:t,brushColor:e.clone()})}},{key:"_onBrushHardnessChanged",value:function(e){var t=this.getSharedState("brushInstance").clone();t.setHardness(e/100),this.setSharedState({brushInstance:t,brushHardness:Math.round(e)})}},{key:"sharedStateDidChange",value:function(e,t){e.brushSize!==t.brushSize&&this._onBrushWidthChanged(t.brushSize)}},{key:"_onBrushWidthChanged",value:function(e){var t=this.context.editor.getOutputDimensions(),n=this.getSharedState("brushInstance").clone();n.setSize(e/t.min()),this.setSharedState({brushInstance:n,brushSize:Math.round(e)})}},{key:"_onOperationUpdated",value:function(e){var t=this.context.editor;if(e===this.getSharedState("operation")){var n=this.getSharedState("brushSprite");if(n){var i=e.getSprites().filter(function(e){return e.getId()===n.getId()})[0];this.setSharedState({brushSprite:i})}t.render()}}},{key:"_onBrushSelect",value:function(e){var t=this,n=this.context.editor.getOutputDimensions(),a=this.getSharedState("brushSize")/n.min(),s=this.getSharedState("brushHardness")/100,l={size:a,color:this.getSharedState("brushColor")},c=void 0;if(e.prototype&&e.prototype instanceof w)c=new e(l);else{var u=y.Utils.extend({},e);delete u.image;var f=function(e){function t(){return i(this,t),r(this,(t.__proto__||g()(t)).apply(this,arguments))}return o(t,w),t}();f.identifier=e.identifier,c=new f(y.Utils.extend({},u,l))}c.hasOption("hardness")&&c.setHardness(s),this._loadBrush(e,c).then(function(){t.setSharedState({brushInstance:c,brush:e})})}},{key:"_loadBrush",value:function(e,t){var n=this;return new _.a(function(i,r){if(e.constructor===Object){var o=new window.Image;o.addEventListener("load",function(){t.setImage(o),i()}),o.addEventListener("error",function(){r(new Error("Failed to load image at "+o.src))}),o.crossOrigin=n.context.editor.getCrossOrigin(),o.src=n._getAssetPath(e.image)}else i()})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderBrushItems",value:function(){var e=this,t=this._brushManager.getBrushes();return t.length<=1?null:t.map(function(t){return v.React.createElement(b.a,{key:t.identifier,identifier:t.identifier,brush:t,selected:e.getSharedState("brush")===t,onClick:e._onBrushSelect.bind(e,t)})})}},{key:"_renderContent",value:function(){var e=this,t=this.getSharedState("brushInstance");return v.React.createElement(v.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},v.React.createElement(T,null,v.React.createElement(O,null,this._t("pesdk.brush.title.settings")),v.React.createElement(R,null,v.React.createElement(v.ColorSelectionComponent,{value:this.getSharedState("brushColor"),colorPalette:this.state.colorPalette,onChange:this._onBrushColorChanged})),v.React.createElement(x,{label:this._t("pesdk.brush.title.width"),minValue:1,maxValue:100,value:this.getSharedState("brushSize"),onSliderValueChange:this._onBrushWidthChanged,onValueChange:this._onBrushWidthChanged,className:void 0}),v.React.createElement(x,{label:this._t("pesdk.brush.title.hardness"),minValue:0,maxValue:100,disabled:!(t&&t.hasOption("hardness")),value:this.getSharedState("brushHardness"),onSliderValueChange:this._onBrushHardnessChanged,onValueChange:this._onBrushHardnessChanged})),v.React.createElement(D,null,v.React.createElement(v.ScrollbarComponent,{direction:"vertical"},v.React.createElement(I,null,this._renderBrushItems()))))}}]),t}();E.contextTypes=v.ControlsComponent.contextTypes,E.RootElement=v.ControlsComponent.RootElement,t.a=E;var x=Object(v.adonis)(v.SliderControlComponent)("6vpx1b","SliderControl"),T=Object(v.adonis)(C).div("r92vc7","Settings"),O=Object(v.adonis)(S).div("120drhm","SettingsTitle"),R=v.adonis.div("yzsuxp","ColorSelection"),D=v.adonis.div("16dil83","Brushes"),I=v.adonis.ul("1lb1mg4","BrushList")},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=d()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(f.a?f()(e,t):e.__proto__=t)}var a=n(0),s=n.n(a),l=n(6),c=n.n(l),u=n(2),f=n.n(u),p=n(3),d=n.n(p),h=n(8),_=n.n(h),m=n(1),g=n.n(m),y=n(7),v=(n.n(y),n(5)),b=(n.n(v),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),s()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),k=v.ControlsStyles.PlainControlItemBackground,w=y.Operations.SpriteOperation,S=void 0,C=void 0;w&&(S=w.BrushSprite.Brush,C=w.BrushSprite.Path);var E=y.Math.Vector2,x=function(e){function t(){return i(this,t),r(this,(t.__proto__||g()(t)).apply(this,arguments))}return o(t,v.BaseComponent),b(t,[{key:"_loadBrush",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.brush;return new _.a(function(n,i){if(t.constructor===Object){var r=new window.Image;r.addEventListener("load",function(){e._brush.setImage(r),n()}),r.addEventListener("error",function(){i(new Error("Failed to load image at "+r.src))}),r.crossOrigin=e.context.editor.getCrossOrigin(),r.src=e._getAssetPath(t.image)}else n()})}},{key:"_drawBrush",value:function(){var e=new C(null,{brush:this._brush},this._canvas);e.addControlPoint(new E(.1,.5)),e.addControlPoint(new E(.9,.5)),e.render(new E(this._canvas.width,this._canvas.height))}},{key:"_instantiateBrush",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.brush,t={color:y.Color.WHITE,size:.25};if(e.prototype&&e.prototype instanceof S){var n=e;this._brush=new n(t)}else{var a=y.Utils.extend({},e);delete a.image;var s=function(e){function t(){return i(this,t),r(this,(t.__proto__||g()(t)).apply(this,arguments))}return o(t,S),t}();s.identifier=e.identifier,this._brush=new s(y.Utils.extend({},a,t))}}},{key:"componentDidMount",value:function(){var e=this;(function e(t,n,i){null===t&&(t=Function.prototype);var r=c()(t,n);if(void 0===r){var o=g()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||g()(t.prototype),"componentDidMount",this).call(this),this._instantiateBrush();var n=this._canvas,i=n.offsetWidth,r=n.offsetHeight;this._canvas.width=i,this._canvas.height=r,this._loadBrush().then(function(t){e._drawBrush()})}},{key:"render",value:function(){var e=this;return v.React.createElement(T,{onClick:this.props.onClick,selected:this.props.selected,className:void 0,"data-selected":this.props.selected,"data-identifier":this.props.identifier},v.React.createElement(O,{innerRef:function(t){e._canvas=t}}))}}]),t}();t.a=x;var T=Object(v.adonis)(k).li("8908c2",{selected:"120drhm"},"BrushListItem"),O=v.adonis.canvas("1ssoezr","Canvas")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(58)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=(d.Operations.SpriteOperation?d.Operations.SpriteOperation:{}).BrushSprite,y=d.Math.Vector2,v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onMouseEnter","_onMouseLeave","_onMouseMove","_onDrawStart","_onDraw","_onDrawStop"),o.state=d.Utils.extend(o.state,{cursorPosition:new y(0,0),canvasClickDisabled:!0}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.a),m(t,[{key:"_selectNextSprite",value:function(){}},{key:"_onDrawStart",value:function(e){var t=this.context.editor.getOutputDimensions();this._initialDrawPosition=e.clone();var n=this.getSharedState("brushSprite"),i=this.getSharedState("brushInstance"),r=this.getSharedState("operation");n||(n=r.createBrush(),r.addSprite(n),this.setSharedState({brushSprite:n})),this._currentPath=n.createPath(i),this._currentPath.addControlPoint(e.clone().divide(t)),this._lastDrawPosition=this._initialDrawPosition.clone(),this._lastCursorPosition=this._initialDrawPosition.clone()}},{key:"_onDraw",value:function(e,t,n){var i=this.context.editor,r=i.getOutputDimensions(),o=i.getOutputTextureDimensions(),a=this._lastCursorPosition.clone().add(n),s=i.zoom.level,l=this.getSharedState("brushSize");a.clone().subtract(this._lastDrawPosition).abs().len()/s>=l/10&&(this._currentPath.addControlPoint(a.clone().divide(r)),this.getSharedState("brushSprite").render(o),this._lastDrawPosition.copy(a)),this._lastCursorPosition.copy(a)}},{key:"_onDrawStop",value:function(){this._currentPath.setClosed(!0);var e=this.context.editor.getOutputTextureDimensions();this.getSharedState("brushSprite").render(e),this.props.controls.addLocalHistorySnapshot(),this._currentPath=null}},{key:"_onMouseEnter",value:function(){this.setState({cursorVisible:!0})}},{key:"_onMouseLeave",value:function(){this.setState({cursorVisible:!1})}},{key:"_onMouseMove",value:function(e){var t=h.Utils.getEventPosition(e),n=this._innerContainer.getBoundingClientRect();t.subtract(n.left,n.top),this.setState({cursorPosition:t})}},{key:"_getPropsForSprite",value:function(e){var n=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_getPropsForSprite",this).call(this,e);return e instanceof g&&(n.hideContent=!1),n}},{key:"_getCursorStyle",value:function(){return{width:this.getSharedState("brushSize")+8,height:this.getSharedState("brushSize")+8,left:this.state.cursorPosition.x,top:this.state.cursorPosition.y,marginLeft:-.5*(this.getSharedState("brushSize")+8),marginTop:-.5*(this.getSharedState("brushSize")+8)}}},{key:"_renderOverlayControls",value:function(){return h.React.createElement(h.DraggableComponent,{onStart:this._onDrawStart,onDrag:this._onDraw,onStop:this._onDrawStop},h.React.createElement(b,{onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave,onMouseMove:this._onMouseMove,className:void 0},h.React.createElement(k,{style:this._getCursorStyle(),visible:this.state.cursorVisible})))}}]),t}();v.contextTypes=_.a.contextTypes,t.a=v;var b=h.adonis.div("1sc5z35","BrushCanvasControls"),k=h.adonis.div("y4v90o",{visible:"2jlos"},"Cursor")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(5),m=(n.n(_),n(59)),g=n(25),y=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o.state={renderAsSVG:!1,svgAttributes:{}},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,m.a),v(t,[{key:"componentDidMount",value:function(){var e=this;if(function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this),this.props.hideContent)return null;var n=this.props.sprite;n.getImage().src.match(/\w+\.svg(?=\?|$)/i)&&"none"!==n.getTintMode()&&g.a.loadXHR(n.getImage().src,"image/svg+xml").then(function(t){for(var n=t.responseXML.documentElement.attributes,i={},r=0;r<n.length;r++){var o=n[r],a=o.name,s=o.value;"xmlns:xlink"===a&&(a="xmlnsXlink"),i[a]=s}var l=t.responseText.match(/<svg\b[^>]*>([\s\S]*?)<\/svg>/im)[1];l=l.replace(/\s+?fill=["'].*?["']/gi,""),e.setState({renderAsSVG:!0,svgContent:l,svgAttributes:i})})}},{key:"_onBeforeScale",value:function(){var e=this.props.sprite;this._initialOptions={dimensions:e.getDimensions().clone()}}},{key:"_onScale",value:function(e){var t=this.context.editor,n=this._initialOptions.dimensions,i=this.props.sprite;i.scalesUniformly()?i.set({dimensions:n.clone().multiply(e.max()/t.zoom.level)}):i.set({dimensions:n.clone().multiply(e.clone().divide(t.zoom.level))}),this.forceUpdate(),t.render()}},{key:"_getSpriteDimensions",value:function(){var e=this.context.editor;return this.props.sprite.getDimensions().clone().multiply(e.zoom.level)}},{key:"_getContainerStyle",value:function(){var e=this.context.editor,t=e.getOutputDimensions(),n=this.props.sprite,i=n.getPosition().clone().multiply(t),r="rotateZ("+(180*n.getRotation()/Math.PI).toFixed(2)+"deg)",o=n.getDimensions().clone().multiply(e.zoom.level);return{width:o.x,height:o.y,left:i.x,top:i.y,marginLeft:-.5*o.x,marginTop:-.5*o.y,transform:r,MozTransform:r,msTransform:r,WebkitTransform:r,transformOrigin:"50% 50%",MozTransformOrigin:"50% 50%",msTransformOrigin:"50% 50%",WebkitTransformOrigin:"50% 50%"}}},{key:"_getContentStyle",value:function(){var e=this.props.sprite,t="rotateY("+(e.getFlipHorizontally()?180:0)+"deg) rotateX("+(e.getFlipVertically()?180:0)+"deg)",n={opacity:e.getAlpha(),transform:t,MozTransform:t,msTransform:t,WebkitTransform:t};return this.state.renderAsSVG&&(n.fill=e.getTintColor().toRGBA()),n}},{key:"_renderContent",value:function(){if(this.props.hideContent)return null;var e=this.props.sprite,t=this.state.svgAttributes;return this.state.renderAsSVG?_.React.createElement(w,y({style:this._getContentStyle(),dangerouslySetInnerHTML:{__html:this.state.svgContent}},t)):_.React.createElement(k,{src:e.getImage().src,style:this._getContentStyle()})}}]),t}();b.contextTypes=m.a.contextTypes,b.MIN_WIDTH=m.a.MIN_WIDTH,t.a=b;var k=_.adonis.img("1ssoezr","Image"),w=_.adonis.svg("1ssoezr","SVGImage")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(7),a=(n.n(o),n(4)),s=n(80),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return l(e,null,[{key:"mapToSnapSystem",value:function(e,t,n,i){if(0===t.length)return e;if(t[0]>e)return e-n;for(var r=0;r<t.length-1;r++){var s=t[r],l=t[r+1],c=s+n,u=l-n,f=0;if(i&&(c+=f=r*n*2,u+=f+2*n),s<=e&&e<=l)return e<=s+1e-5?s+f:e>=l-1e-5?l+f+(i?2*n:0):o.Utils.mapRange(e,new a.l(s,l),new a.l(c,u))}return i?e+(t.length-1)*n*2+n:e}},{key:"mapFromSnapSystem",value:function(e,t,n,i){if(0===t.length)return e;if(t[0]>e)return e>=t[0]-n?t[0]:e+n;for(var r=e,s=0;s<t.length-1;s++){var l=t[s],c=t[s+1],u=l+n,f=c-n,p=c;if(i&&(f+=2*n,p+=2*n,r=e-s*n*2),l<=r&&r<=p)return u<=r&&r<=f?o.Utils.mapRange(r,new a.l(u,f),new a.l(l,c)):r<u?l:c}r-=3*n;var d=t[t.length-1];return r<=d?d:r}},{key:"mapSnappingGuidesToCenter",value:function(e,t){var n=.5*t,i=[];return e.forEach(function(e){e.getEdges().forEach(function(t){var r=e.getValue();t===s.a.Edge.LEADING?r+=n:t===s.a.Edge.TRAILING&&(r-=n),i.push(new s.a({edges:[s.a.Edge.CENTER],value:r,originalGuide:e}))})}),i}},{key:"calcSnapThresholdInRadians",value:function(e,t){return 0===e?0:t/e}}]),e}();t.a=c},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(59)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},y=d.Math.Vector2,v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._onItemTouchEnd=function(){o._hasTouchStarted&&++o._touchCount>=2&&(clearTimeout(o._touchTimeout),o._hasTouchStarted=!1,o._touchCount=0,o.props.selected&&o.enterEditMode())},o._bindAll("_onTextChange","_onBlur","_onItemDoubleClick","_onWidthDrag","_onWidthDragStop","_onItemTouchStart"),o.state={editing:!1,updateBecauseIESucks:!1},o._hasTouchStarted=!1,o._touchCount=0,o._touchTimeout=null,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.a),m(t,[{key:"componentDidMount",value:function(){g(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._updateSpriteVisibility()}},{key:"componentDidUpdate",value:function(){this._updateSpriteVisibility()}},{key:"componentWillUnmount",value:function(){this.props.sprite.setVisible(!0),g(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this)}},{key:"_updateSpriteVisibility",value:function(){this.props.sprite.getVisible()!==!this.state.editing&&this.props.sprite.setVisible(!this.state.editing)}},{key:"_isDraggingDisabled",value:function(){return g(t.prototype.__proto__||p()(t.prototype),"_isDraggingDisabled",this).call(this)||this.state.editing}},{key:"enterEditMode",value:function(){var e=this,t=this.props.sprite;this.setState({editing:!0},function(){t._edited||(t.setText(""),e._textField.value="",t._edited=!0),e._textField.focus(),e._textField.select(),e.forceUpdate()})}},{key:"leaveEditMode",value:function(){this.setState({editing:!1})}},{key:"shouldComponentUpdate",value:function(){return!0}},{key:"_onTakeToFront",value:function(){var e;this.leaveEditMode();for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];(e=g(t.prototype.__proto__||p()(t.prototype),"_onTakeToFront",this)).call.apply(e,[this].concat(i))}},{key:"_onFlipHorizontally",value:function(){var e;this.leaveEditMode();for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];(e=g(t.prototype.__proto__||p()(t.prototype),"_onFlipHorizontally",this)).call.apply(e,[this].concat(i))}},{key:"_onDuplicate",value:function(){var e;this.leaveEditMode();for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];(e=g(t.prototype.__proto__||p()(t.prototype),"_onDuplicate",this)).call.apply(e,[this].concat(i))}},{key:"_onSpriteUpdate",value:function(e,n){var i=this;h.Utils.Browser.isIElte(10)&&n.alignment&&e.getAlignment()!==n.alignment&&this.setState({updateBecauseIESucks:!0},function(){Object(h.requestAnimationFrame)(function(){i.setState({updateBecauseIESucks:!1})})}),g(t.prototype.__proto__||p()(t.prototype),"_onSpriteUpdate",this).call(this)}},{key:"_onWidthDragStart",value:function(e,t,n){var i=this.context.editor,r=this.props.sprite,o=r.getAnchor();this._imageBoundingBox=this.props.canvasControls.getImageBoundingRect(),this._containerOffset=this.props.canvasControls.getContainerOffset();var a=this._getAbsoluteSpritePosition().add(this._imageBoundingBox.x,this._imageBoundingBox.y),s=r.getDimensions(i.getSDK(),i.getOutputDimensions()),l=new y(s.width,s.height),c=a.clone().subtract(l.clone().multiply(o)).add(l.clone().multiply(.5)).round(),u=n.clone().subtract(this._containerOffset).subtract(c);this._initialScaleSettings={maxWidth:r.getMaxWidth(),mouseDistanceFromCenter:u},this.props.onBeforeChange&&this.props.onBeforeChange(),this.props.onCanvasClickDisabled&&this.props.onCanvasClickDisabled()}},{key:"_onWidthDrag",value:function(e){var t=this.props.sprite,n=t.getRotation(),i=this._initialScaleSettings.mouseDistanceFromCenter.clone().add(e),r=Math.cos(n),o=Math.sin(n),a=Math.max(Math.abs(2*(i.x*r+i.y*o)),50)/this._imageBoundingBox.width;t.setMaxWidth(a),this.context.editor.render()}},{key:"_onWidthDragStop",value:function(){this.props.onAfterChange&&this.props.onAfterChange(),this.props.onCanvasClickEnabled&&this.props.onCanvasClickEnabled()}},{key:"_onBlur",value:function(){this.leaveEditMode();var e=this.props.sprite;e&&""===e.getText()&&(e.setText(this._t("pesdk.text.placeholder.defaultText")),e._edited=!1,this.forceUpdate())}},{key:"_onTextChange",value:function(e){this.props.sprite.setText(e.target.value),this.forceUpdate()}},{key:"_onItemDoubleClick",value:function(){this.props.selected&&this.enterEditMode()}},{key:"_onItemTouchStart",value:function(){var e=this;this._hasTouchStarted||(this._hasTouchStarted||(this._hasTouchStarted=!0,this._touchCount=0),this._touchTimeout=setTimeout(function(){e._hasTouchStarted=!1,e._touchCount=0},300))}},{key:"_onBeforeScale",value:function(){var e=this.props.sprite;this._initialOptions={maxWidth:e.getMaxWidth(),fontSize:e.getFontSize()}}},{key:"_onScale",value:function(e){var t=this._initialOptions,n=t.maxWidth,i=t.fontSize,r=this.props,o=r.sprite,a=r.canvasControls.getSharedState("inputDimensions"),s=h.Utils.toFixed(i*e.x*a.min(),1),l=Math.round(a.y),c=h.Utils.toFixed(Math.max(10,Math.min(s,l)),1);o.set({maxWidth:n*e.x,fontSize:c/a.min()}),this.context.mediator.emit(h.Constants.EVENTS.TEXT_SCALED,o),this.forceUpdate()}},{key:"_getContainerStyle",value:function(){var e=this.context.editor,t=e.getOutputDimensions(),n=this.props.sprite,i=n.getPosition().clone().multiply(t),r="rotateZ("+(180*n.getRotation()/Math.PI).toFixed(2)+"deg)",o=n.getMaxWidth()*t.x,a=n.getDimensions(e.getSDK(),t).y;return{width:o,height:a,left:i.x,top:i.y,marginLeft:-.5*o,marginTop:-.5*a,transform:r,MozTransform:r,msTransform:r,WebkitTransform:r,transformOrigin:"50% 50%",MozTransformOrigin:"50% 50%",msTransformOrigin:"50% 50%",WebkitTransformOrigin:"50% 50%"}}},{key:"_getTextStyle",value:function(){var e=this.context.editor,t=this.props.sprite,n=e.getSDK(),i=e.getOutputDimensions(),r=t.getDOMStyle(n,i),o=this._getAbsoluteSpritePosition(),a=t.getDimensions(n,i);return r.height=Math.min(a.y,i.y-o.y+a.y/2),r}},{key:"_renderControls",value:function(){var e=this,n=g(t.prototype.__proto__||p()(t.prototype),"_renderControls",this).call(this);return["left","right"].forEach(function(t){var i="width-"+t,o=function(e,t,n){return t in e?r()(e,t,{value:!0,enumerable:!0,configurable:!0,writable:!0}):e[t]=!0,e}({},t);n.push(h.React.createElement(h.DraggableComponent,{key:i,onStart:e._onWidthDragStart.bind(e,t),onDrag:e._onWidthDrag,onStop:e._onWidthDragStop},h.React.createElement(w,o)))}),n}},{key:"_getItemControlsProps",value:function(){return{onDoubleClick:this._onItemDoubleClick,onTouchStart:this._onItemTouchStart,onTouchEnd:this._onItemTouchEnd}}},{key:"_renderContent",value:function(){var e=this,t=this.props,n=t.sprite,i=t.selected,r=this.state,o=r.editing,a=r.updateBecauseIESucks,s=[];return this.state.editing&&s.push(h.React.createElement(b,{key:"text-field",editing:o,innerRef:function(t){e._textField=t},style:this._getTextStyle(),defaultValue:n.getText(),onBlur:this._onBlur,onChange:this._onTextChange,updateBecauseIESucks:a})),this.state.editing||s.push(h.React.createElement(k,{key:"disabled-overlay",className:void 0,selected:i})),s}}]),t}();v.contextTypes=_.a.contextTypes,v.MIN_WIDTH=100;var b=h.adonis.textarea("12u5t8c",{updateBecauseIESucks:"ckktkq",editing:"15kzu1c"},"TextField"),k=h.adonis.div("8gacw5","DisabledOverlay"),w=h.adonis.div("dv4w7b",{left:"tr97e1",right:"1llojum"},"WidthControl");t.a=v},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(59)),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.a),_(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this);var e=this.props.sprite.getCanvas();this._brush&&this._appendCanvas(e)}},{key:"componentWillReceiveProps",value:function(e){if(e.sprite!==this.props.sprite){var t=this.props.sprite.getCanvas();if(t.parentNode.removeChild(t),this._brush){var n=e.sprite.getCanvas();this._appendCanvas(n)}}}},{key:"_appendCanvas",value:function(e){e.style.width="100%",e.style.height="100%",this._brush.appendChild(e)}},{key:"_renderOverlayControls",value:function(){return null}},{key:"render",value:function(){var e=this;return this.props.hideContent?null:d.React.createElement(g,{innerRef:function(t){e._brush=t}})}}]),t}();t.a=m;var g=d.adonis.div("8gacw5","BrushItem")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(59),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.CONTROLS_MARGIN=0,o._onItemDoubleClick=function(){return o.props.canvasControls.props.controls.editText()},o._onItemTouchStart=function(){o._hasTouchStarted||(o._hasTouchStarted||(o._hasTouchStarted=!0,o._touchCount=0),o._touchTimeout=setTimeout(function(){o._hasTouchStarted=!1,o._touchCount=0},300))},o._onItemTouchEnd=function(){if(o._hasTouchStarted){var e=o.props.canvasControls.props.controls;++o._touchCount>=2&&(clearTimeout(o._touchTimeout),o._hasTouchStarted=!1,o._touchCount=0,e.editText())}},o.state={},o._hasTouchStarted=!1,o._touchCount=0,o._touchTimeout=null,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.a),h(t,[{key:"_onBeforeScale",value:function(){var e=this.props.sprite;this._initialOptions={width:e.getWidth()}}},{key:"_onScale",value:function(e){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"_onScale",this).apply(this,arguments);var n=this.context.editor,i=this._initialOptions.width;this.props.sprite.set({width:i*(e.x/n.zoom.level)}),this.forceUpdate(),n.render()}},{key:"_getSpriteDimensions",value:function(){var e=this.context.editor;return this.props.sprite.getDimensions().clone().multiply(e.zoom.level)}},{key:"_getContainerStyle",value:function(){var e=this.context.editor,t=e.getOutputDimensions(),n=this.props.sprite,i=n.getPosition().clone().multiply(t),r="translate(-50%, -50%) rotateZ("+(180*n.getRotation()/Math.PI).toFixed(2)+"deg)",o=n.getDimensions().clone().multiply(e.zoom.level);return{width:o.x+2*this.CONTROLS_MARGIN,height:o.y+2*this.CONTROLS_MARGIN,left:i.x,top:i.y,transform:r,MozTransform:r,msTransform:r,WebkitTransform:r,transformOrigin:"50% 50%",MozTransformOrigin:"50% 50%",msTransformOrigin:"50% 50%",WebkitTransformOrigin:"50% 50%"}}},{key:"_getContentStyle",value:function(){}},{key:"_getItemControlsProps",value:function(){return{onDoubleClick:this._onItemDoubleClick,onTouchStart:this._onItemTouchStart,onTouchEnd:this._onItemTouchEnd}}},{key:"_renderContent",value:function(){return null}}]),t}();_.contextTypes=d.a.contextTypes,_.MIN_WIDTH=d.a.MIN_WIDTH,t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=(n.n(f),n(5)),d=n.n(p),h=n(348),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.BaseControls),_(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=e.getOrCreate("filter");return{intensity:t?100*t.getIntensity():100,identifier:t?t.getIdentifier():null,filter:t?t.filter:null,setIntensity:function(e){t&&t.setIntensity(e/100)},setFilter:function(e){t&&t.setFilter(e)},setIdentifier:function(e){t&&t.setIdentifier(e)},setOperationOptions:function(e){t&&t.set(e)},resetToDefaultIntensity:function(){t&&t.resetToDefaultFilterIntensity()}}}}],[{key:"isEnabled",value:function(e){return e.isToolEnabled("filter")&&e.isToolAllowed("filter")}},{key:"getPreloadAssets",value:function(e){var t=[],n=e.getOptions(),i=f.Utils.defaults(n.editor.controlsOptions.filter,this.defaultOptions);return new p.FilterManager(e.getUI(),i).getFiltersForCategory("all").forEach(function(e){void 0!==e.lutImage&&t.push([e.lutImage,!1])}),t}}]),t}();m.clickAtPosition=p.BaseControls.clickAtPosition,m.identifier="filter",m.controlsComponent=h.a,m.canvasControlsComponent=p.BaseControls.canvasControlsComponent,m.iconPath="editor/controls/filter/icon.png",m.activeIconPath="editor/controls/filter/icon-active.png",m.requiredOperations=["filter","transform"],m.updatableOperations=["filter"],m.switchToDefaultControlsOnRemoval=!1,m.defaultOptions={categories:[],replaceCategories:!1,availableFilters:null},d.a.Controls.FilterControls=m,t.a=m},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(32),h=n.n(d),_=n(8),m=n.n(_),g=n(1),y=n.n(g),v=n(7),b=n.n(v),k=n(5),w=(n.n(k),n(89)),S=n(15),C=n(349),E=n(350),x=n(351),T=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},O=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),R=function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=y()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},D=void 0;v.Operations.FilterOperation&&(D=v.Operations.FilterOperation.Filters.IdentityFilter);var I=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||y()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onIntensityChanged","_handleCategoryChange");var a=o.context,s=a.ui,l=a.editor,c=a.theme;return o._loadedFilters=[],o._filterPreviewRenderer=new E.a(l),o._renderQueue=new w.a(1,1/0,c.listItemSlideInDelay),o._filterManager=new k.FilterManager(s,o.props.options),o._filterRefs={},o._scrollableListRef=null,o._scrollableListInnerRef=k.React.createRef(),o._scrollableListComponentRef=k.React.createRef(),o._categoriesRef=k.React.createRef(),o._filterPreviews={},o.state=T({},o.state,{activeCategory:o._getActiveCategoryBySelectedFilter()}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,k.ControlsComponent),O(t,[{key:"componentDidMount",value:function(){var e=this;R(t.prototype.__proto__||y()(t.prototype),"componentDidMount",this).call(this),this._filterPreviewRenderer.init(),this._setScrollPositionToActiveItem(),this._renderPreviewsAnimationFrame=Object(S.b)(function(){e._renderPreviews()})}},{key:"componentWillUnmount",value:function(){R(t.prototype.__proto__||y()(t.prototype),"componentWillUnmount",this).call(this),this._renderPreviewsAnimationFrame&&Object(S.a)(this._renderPreviewsAnimationFrame),this._renderQueue.dispose(),this._filterPreviewRenderer.dispose(),this._disposed=!0,window.clearInterval(this._interval)}},{key:"componentDidUpdate",value:function(){this._updateScrollbar()}},{key:"_setScrollPositionToActiveItem",value:function(){if(!this.sharedState.identifier)return!1;var e=this._filterRefs["filter-"+this.sharedState.identifier];this.sharedState.identifier===D.identifier&&this._scrollableListRef?this._scrollableListRef.scrollTop=0:e&&e.current&&this._setScrollPositionToElement(e.current._container)}},{key:"_setScrollPositionToElement",value:function(e){if(this._scrollableListRef){var n=e.getBoundingClientRect().top-this._header.clientHeight+t.SCROLL_ITEM_OFFSET;isNaN(n)||(this._scrollableListRef.scrollTop=n)}}},{key:"_updateScrollbar",value:function(){var e=this;setTimeout(function(){e._scrollableListInnerRef.current.update()},1e3*this.context.theme.transitionDuration+50)}},{key:"_renderPreviews",value:function(){var e=this,n=this.context.editor.getSDK().getRenderer(),i=this._getVisibleFilters().filter(function(t){return-1===e._loadedFilters.indexOf(t)});n.isOfType(b.a.RendererType.WEBGL)?i.forEach(function(t){e._loadedFilters.push(t),e._renderQueue.add(function(){return e._filterManager.instantiateFilterWithIdentifier(t.identifier).then(function(n){if(!e._disposed)return e._filterPreviewRenderer.render(n).then(function(n){e._filterPreviews[t.identifier]=n,e.forceUpdate()})})})}):(this._loadedFilters=this._loadedFilters.concat(i),i.forEach(function(n){e._renderQueue.add(function(){return new m.a(function(i){e._filterPreviews[n.identifier]=e._getAssetPath(t.ASSETS_ROOT_PATH+"filters/"+n.identifier+".jpg",!0),e.forceUpdate(),i()})})}))}},{key:"_getVisibleFilters",value:function(){var e=[D];return this._filterManager.getCategories().filter(function(e){return!!e.displayFlat}).forEach(function(t){e=e.concat(t.filters)}),this.state.activeCategory?e.concat(this._filterManager.getFiltersForCategory(this.state.activeCategory)):e}},{key:"_handleCategoryChange",value:function(e){var t=this;e===this.state.activeCategory&&(e=""),this.setState(T({},this.state,{activeCategory:e}),function(){t._renderPreviews(),t._updateScrollbar()})}},{key:"_onItemClick",value:function(e){var t=this;this.sharedState.identifier!==e&&this._filterManager.instantiateFilterWithIdentifier(e).then(function(n){t.sharedState.setOperationOptions({filter:n,identifier:e}),t.sharedState.resetToDefaultIntensity(),t.context.editor.render()})}},{key:"_onIntensityChanged",value:function(e){this.sharedState.setIntensity(e)}},{key:"_getActiveCategoryBySelectedFilter",value:function(){var e=this._filterManager.getCategories().filter(function(e){return!1!==e.visible}),t=!0,n=!1,i=void 0;try{for(var r,o=h()(e);!(t=(r=o.next()).done);t=!0){var a=r.value,s=!0,l=!1,c=void 0;try{for(var u,f=h()(a.filters);!(s=(u=f.next()).done);s=!0){var p=u.value.identifier;if(this.sharedState.identifier===p)return a.identifier}}catch(e){l=!0,c=e}finally{try{!s&&f.return&&f.return()}finally{if(l)throw c}}}}catch(e){n=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw i}}}},{key:"_generateCategoriesFilterData",value:function(){var e=this._filterManager.getCategories(),t={},n=!0,i=!1,r=void 0;try{for(var o,a=h()(e);!(n=(o=a.next()).done);n=!0){var s=o.value.identifier;t[s]=this._filterManager.getItemsByCategory(s)}}catch(e){i=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}return t}},{key:"_renderCategoryHeader",value:function(e,n){var i=this._filterManager.getCategoryByIdentifier(e),r={};if(i.assetFileName){var o=this._getAssetPath(t.ASSETS_ROOT_PATH+"categories/"+i.assetFileName+".jpg",!0);r.backgroundImage="url("+o+")"}return k.React.createElement(M,{className:void 0,expanded:n,style:r},k.React.createElement(N,null,k.React.createElement(F,null,k.React.createElement(j,null,i.defaultName,k.React.createElement(B,{active:n,src:this._getAssetPath("editor/controls/shared/triangle-down.png",!0)})))))}},{key:"_renderCategoryItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=e===D;n=r||i||n;var o=e.identifier,a=this.sharedState.identifier,s=this._filterPreviews,l=this.sharedState.intensity,c=o===a,u=!r&&!i,f=void 0,p=void 0;return t&&(p=(f=this._filterManager.getCategoryByIdentifier(t).filters)&&f.indexOf(e)===f.length-1),this._filterRefs["filter-"+o]=k.React.createRef(),k.React.createElement(A,{key:o,"data-selected":c,"data-identifier":o,className:void 0},k.React.createElement(C.a,{ref:this._filterRefs["filter-"+e.identifier],filter:e,identifier:e.identifier,visible:!!s[e.identifier],expanded:n||void 0,lastChild:p,animated:u,selected:c,indentation:!i,intensity:l,isIdentityFilter:r,displaySlider:e!==D,previewUrl:s[e.identifier],onClick:this._onItemClick.bind(this,e.identifier),onIntensityChanged:this._onIntensityChanged}))}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this,t=this._filterManager.getCategories().filter(function(e){return!1!==e.visible});return k.React.createElement(k.ScrollableListComponent,{direction:"vertical",ref:this._scrollableListComponentRef,innerRef:this._scrollableListInnerRef,innerListRef:function(t){e._scrollableListRef=t}},k.React.createElement(P,null,k.React.createElement(x.a,{ref:this._categoriesRef,activeCategoryIdentifier:this.state.activeCategory,onCategoryChange:this._handleCategoryChange,categories:t,items:this._generateCategoriesFilterData(),identityItem:D,renderHeader:this._renderCategoryHeader.bind(this),renderItem:this._renderCategoryItem.bind(this)})))}}]),t}();I.contextTypes=k.ControlsComponent.contextTypes,I.propTypes=k.ControlsComponent.propTypes,I.RootElement=k.ControlsComponent.RootElement,I.ASSETS_ROOT_PATH="editor/controls/filter/",I.SCROLL_ITEM_OFFSET=16,t.a=I;var P=k.adonis.div("13qin9t","PaddingContainer"),A=k.adonis.div("13hv8io","ListItemContainer"),M=Object(k.adonis)(k.ControlsStyles.ControlItem).div("mis9wn",{expanded:"xbkerq"},"CategoryHeader"),F=Object(k.adonis)(k.ControlsStyles.ControlItemTitle).span("hpn4lp","CategoryHeaderTitleWrapper"),j=k.adonis.span("13hv8io","CategoryHeaderTitle"),B=k.adonis.img("7wtnq9",{active:"6ro6jp"},"CategoryHeaderTitleArrowIcon"),N=k.adonis.div("133t8sq",{expanded:"1etxnci"},"CategoryHeaderTitleFading")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(24),h=n.n(d),_=n(5),m=(n.n(_),r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=_.ControlsStyles.ControlItem,v=_.ControlsStyles.ControlItemActiveOverlay,b=_.ControlsStyles.ControlItemTitle,k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.state={hovered:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.BaseComponent),g(t,[{key:"shouldComponentUpdate",value:function(e,t){return this.props.previewUrl!==e.previewUrl||this.props.selected!==e.selected||this.props.expanded!==e.expanded||this.props.visible!==e.visible||this.state.hovered!==t.hovered||this.state.animated!==t.animated||this.state.lastChild!==t.lastChild||this.props.filter!==e.filter||!(this.props.intensity===e.intensity||!e.selected)}},{key:"render",value:function(){var e=this,t=this.props,n=t.onClick,i=t.animated,r=t.expanded,o=t.indentation,a=t.lastChild,s=t.isIdentityFilter,l=t.onIntensityChanged,c=t.selected,u=t.intensity,f=t.displaySlider,p=t.isDivergingSlider,d=t.visible,h=t.filter,g=this.context.theme.transitionDuration,y={onClick:n,animated:i,visible:d,expanded:r,isIdentityFilter:s,indentation:o},v=c&&!r,b={};return this.props.previewUrl&&(b.backgroundImage="url("+this.props.previewUrl+")"),_.React.createElement(w,m({},y,{hasMarginBottom:a&&r,innerRef:function(t){e._container=t},onMouseEnter:function(){return e.setState({hovered:!0})},onMouseLeave:function(){return e.setState({hovered:!1})}}),_.React.createElement(C,{hidden:v,selected:c,style:b},_.React.createElement(_.Transition,{active:c&&f,enterProp:"rendered",enterDuration:1e3*g,appearProp:"visible",appearDuration:1e3*g,leaveDuration:1e3*g},c&&f&&_.React.createElement(S,null,_.React.createElement(_.SliderComponent,{minValue:0,maxValue:100,idleValue:p?50:void 0,valueUnit:"",middleDot:p,value:u,onChange:l}))),_.React.createElement(E,{hovered:this.state.hovered},this._t("pesdk.filter.asset."+h.identifier)||h.defaultName),_.React.createElement(_.Transition,{active:c,enterProp:"rendered",enterDuration:1e3*g,appearProp:"visible",appearDuration:1e3*g,leaveDuration:1e3*g},_.React.createElement(x,{selected:c}))))}},{key:"container",get:function(){return this._container}}]),t}();k.contextTypes=_.BaseComponent.contextTypes,k.propTypes=m({},_.BaseComponent.propTypes,{expanded:h.a.bool,animated:h.a.bool,indentation:h.a.bool,isDivergingSlider:h.a.bool}),t.a=k;var w=Object(_.adonis)(y).div("13hmz39",{indentation:"n70ook",animated:"1o7b5tz",expanded:"p8r0wp",visible:"19h4onn",hasMarginBottom:"yzsuxp",isIdentityFilter:"h7mqj7"},"Item"),S=_.adonis.div("19g9ike",{visible:"zgbg08",rendered:"2jlos"},"Slider"),C=_.adonis.div("164bps9",{hidden:"qbdcep"},"ItemContainer"),E=Object(_.adonis)(b).span("11d53sa","ItemTitle"),x=Object(_.adonis)(v).div("120drhm","Overlay")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(7),a=n.n(o),s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=o.Math.Vector2,c=new l(180,80),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._editor=t,this._disposed=!1}return s(e,[{key:"init",value:function(){this._initSDK()}},{key:"render",value:function(e){var t=this;return this._filterOperation.setFilter(e),this._filterOperation.resetToDefaultFilterIntensity(),this._sdk.render().then(function(){return t._sdk.getCanvas().toDataURL("image/png")})}},{key:"_initSDK",value:function(){var e=this._editor.getOptions(),t=e.logLevel,n=e.debug,i=e.license,r=e.editor,o=r.smoothDownscaling,s=r.smoothUpscaling,l=r.preferredRenderer,u=this._editor.getSDK(),f={logLevel:t,debug:n,pixelRatio:1,smoothDownscaling:o,smoothUpscaling:s,transparent:!0,license:i,image:u.getImage(),exif:u.getExif(),renderMode:"export",versionCheck:!1,displayWelcomeMessage:!1};this._sdk=new a.a(l,f),this._sdk.resizeTo(c),this._filterOperation=this._sdk.createOperation("filter"),this._transformOperation=this._sdk.createOperation("transform");var p=this._calculateTransformOptions(),d=p.start,h=p.end,_=p.textureScale;this._transformOperation.set({start:d,end:h,textureScale:_}),this._sdk.render()}},{key:"_calculateTransformOptions",value:function(){var e=this._transformOperation.getInputDimensions(),t=e.x/e.y,n=new l,i=new l,r=c.x/c.y;if(t<=r){var o=1/e.y*(e.x/r);n.set(0,(1-o)/2),i.set(1,1-n.y)}else{var a=1/e.x*(r*e.y);n.set((1-a)/2,0),i.set(1-n.x,1)}var s=i.clone().subtract(n),u=e.clone().multiply(s),f=c.x/u.x;return{dimensions:c,start:n,end:i,textureScale:f}}},{key:"dispose",value:function(){this._sdk&&this._sdk.dispose()}},{key:"isDisposed",value:function(){return this._disposed}}]),e}();t.a=u},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(24),m=n.n(_),g=n(5),y=(n.n(g),n(4)),v=n(352),b=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||h()(t)).call(this,e));return n._bindAll("_handleCategoryHeaderClick"),n.state=b({},n.state,{activeCategory:e.activeCategoryIdentifier}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,y.b),k(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0})(t.prototype.__proto__||h()(t.prototype),"componentDidMount",this).call(this)}},{key:"componentWillReceiveProps",value:function(e){e.identifier!==this.state.activeCategory&&this.setState(b({},this.state,{activeCategory:e.identifier}))}},{key:"_handleCategoryHeaderClick",value:function(e){this.props.onCategoryChange&&this.props.onCategoryChange(e)}},{key:"_renderCategory",value:function(e){return g.React.createElement(C,{className:void 0,"data-identifier":e.identifier,key:e.identifier},g.React.createElement(v.a,{identifier:e.identifier,displayFlat:e.displayFlat,isExpanded:this.props.activeCategoryIdentifier===e.identifier,items:this.props.items[e.identifier],onHeaderClicked:this._handleCategoryHeaderClick,renderItem:this.props.renderItem,renderHeader:this.props.renderHeader}))}},{key:"render",value:function(){return g.React.createElement(S,{className:void 0},this.props.identityItem&&this.props.renderItem(this.props.identityItem),this.props.categories.map(this._renderCategory.bind(this)))}}]),t}();w.propTypes=b({},y.b.propTypes,{activeCategoryIdentifier:m.a.string,onCategoryChange:m.a.func.isRequired,categories:m.a.array.isRequired,items:m.a.object.isRequired,identityItem:m.a.any,renderHeader:m.a.func.isRequired,renderItem:m.a.func.isRequired}),t.a=w;var S=g.adonis.ul("120drhm","Categories"),C=g.adonis.li("120drhm","CategoryComponentContainer")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(24),h=n.n(d),_=n(5),m=(n.n(_),n(4)),g=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,m.b),y(t,[{key:"_handleHeaderClick",value:function(){this.props.onHeaderClicked&&this.props.onHeaderClicked(this.props.identifier)}},{key:"_renderBody",value:function(){var e=this,t=this.props.displayFlat||this.props.isExpanded,n=this.props.items.map(function(n,i){return _.React.createElement(C,{className:void 0,key:i},e.props.renderItem(n,e.props.identifier,t,e.props.displayFlat))});return this.props.displayFlat?n:_.React.createElement(w,null,_.React.createElement(S,null,n))}},{key:"render",value:function(){return _.React.createElement(b,{className:void 0},!this.props.displayFlat&&_.React.createElement(k,{className:void 0,onClick:this._handleHeaderClick.bind(this)},this.props.renderHeader(this.props.identifier,this.props.isExpanded)),this._renderBody())}}]),t}();v.propTypes=g({},m.b.propTypes,{identifier:h.a.string.isRequired,displayFlat:h.a.bool,items:h.a.array.isRequired,isExpanded:h.a.bool,renderItem:h.a.func.isRequired,renderHeader:h.a.func.isRequired,onHeaderClicked:h.a.func}),t.a=v;var b=_.adonis.ul("120drhm","CategoryContainer"),k=_.adonis.li("120drhm","CategoryHeader"),w=_.adonis.li("120drhm","CategoryContentWrapper"),S=_.adonis.ul("120drhm","CategoryContent"),C=_.adonis.li("120drhm","CategoryItem")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),n(354)),d=(n(150),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onBlurRadiusChanged"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.ControlsComponent),d(t,[{key:"_isModeAvailable",value:function(e){var t=this.props.options.availableModes;return"none"===e||null===t||-1!==t.indexOf(e)}},{key:"_onItemClick",value:function(e){!(arguments.length>1&&void 0!==arguments[1])||arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.sharedState.setSelectedFocus(e)}},{key:"_onBlurRadiusChanged",value:function(e){this.sharedState.setBlurRadius(e)}},{key:"_renderListItems",value:function(){var e=this,t=this.props.controls,n=this.sharedState.operationIdentifier,i=this.sharedState.selectedFocus,r=this.sharedState.blurRadius;return t.constructor.ITEMS.filter(function(t){return e._isModeAvailable(t.identifier)}).map(function(t){var o=e._getAssetPath(t.backgroundImagePath,!0),a=e._getAssetPath(t.activeBackgroundImagePath,!0),s=t.identifier===i;return f.React.createElement(p.a,{key:t.identifier,title:e._t("pesdk.focus.button."+t.identifier),selected:s,showSlider:!!n,blurRadius:r,onBlurRadiusChanged:e._onBlurRadiusChanged,backgroundImagePath:o,activeBackgroundImagePath:a,onClick:e._onItemClick.bind(e,t,!0,!1)})},this)}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this;return f.React.createElement(f.ScrollableListComponent,{direction:"vertical",innerListRef:function(t){e._list=t},innerRef:function(t){e._scrollbar=t}},f.React.createElement(_,null,this._renderListItems()))}}]),t}();h.contextTypes=f.ControlsComponent.contextTypes,h.propTypes=f.ControlsComponent.propTypes,h.RootElement=f.ControlsComponent.RootElement,t.a=h;var _=f.adonis.ul("1snluvd","List")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.ControlItem,h=f.ControlsStyles.ControlItemTitle,_=f.ControlsStyles.ControlItemActiveOverlay,m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onSliderValueChanged"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.SharedStateComponent),p(t,[{key:"_onSliderValueChanged",value:function(e){var t=this.props.onBlurRadiusChanged,n=this.sharedState.inputDimensions.min();t&&t(e/n)}},{key:"_renderSlider",value:function(){var e=this.props,t=e.selected,n=e.showSlider,i=e.blurRadius;if(!t||!n)return null;var r=this.sharedState.inputDimensions,o=Math.min(180,Math.round(.1*r.min())),a=r.min();return f.React.createElement(f.SliderComponent,{minValue:0,maxValue:o,valueUnit:"",middleDot:!1,value:i*a,onChange:this._onSliderValueChanged})}},{key:"render",value:function(){var e=this.props,t=e.title,n=e.backgroundImagePath,i=e.activeBackgroundImagePath,r=e.selected,o=e.onClick,a=e.showSlider,s={backgroundImage:"url('"+(r?i:n)+"')"},l=this.context.theme.transitionDuration;return f.React.createElement(g,{selected:r,"data-selected":r,className:void 0,onClick:o,style:s},f.React.createElement(y,{selected:r,withSlider:r&&a},t),f.React.createElement(b,{visible:r&&a},this._renderSlider()),f.React.createElement(f.Transition,{active:r,enterProp:"rendered",enterDuration:1e3*l,appearProp:"visible",appearDuration:1e3*l,leaveDuration:1e3*l},f.React.createElement(v,{selected:!0})))}}]),t}();m.contextTypes=f.SharedStateComponent.contextTypes,t.a=m;var g=Object(f.adonis)(d).li("19qom6j","ListItem"),y=Object(f.adonis)(h).div("1cwztpc",{selected:"2znik8",withSlider:"fsvvyb"},"ListItemTitle"),v=Object(f.adonis)(_).div("rctda3","ListItemOverlay"),b=f.adonis.div("chwlso",{visible:"vpr3tu"},"Slider")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(4),h=n(7),_=(n.n(h),n(5)),m=(n.n(_),n(356)),g=n(357),y=n(358),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return a._bindAll("_onZoomDone"),a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},_.Constants.EVENTS.ZOOM_DONE,a._onZoomDone),a.state=h.Utils.extend(a.state,{zoomDone:!1}),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.CanvasControlsComponent),v(t,[{key:"_onZoomDone",value:function(){this.setState({zoomDone:!0})}},{key:"_getContainerStyle",value:function(){if("linear"!==this.sharedState.selectedFocus)return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_getContainerStyle",this).call(this);var e=this.getImageBoundingRect();return{left:e.x-0,top:e.y,width:e.width+0,height:e.height}}},{key:"_renderControls",value:function(){var e=this,t=this.sharedState.selectedFocus,n=this._imageContainer&&this._getContainerStyle(),i=void 0;switch(t){case"radial":i=m.a;break;case"linear":i=g.a;break;case"mirrored":i=y.a}return _.React.createElement(k,{innerRef:function(t){e._imageContainer=t},style:n,onMouseDown:function(t){e._initialMousePosition=d.v.getEventPosition(t)},onClick:function(t){var n=e._initialMousePosition;n&&!d.v.getEventPosition(t).equals(n)||e._onCanvasClick(t)}},i&&_.React.createElement(i,{zoomDone:this.state.zoomDone}))}}]),t}();b.contextTypes=_.CanvasControlsComponent.contextTypes,t.a=b;var k=d.x.div("o5vg7n","Container")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(15)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=h.ControlsStyles.Knob,y=h.ControlsStyles.FullContainer,v=d.Math.Vector2,b=d.Math.Rectangle,k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return a._bindAll("_onCircleDragStart","_onCircleDrag","_onKnobDragStart","_onKnobDrag","_onZoomDone"),a.state=d.Utils.extend(a.state,{circlePosition:new v,circleDimensions:new v,knobPosition:new v,visible:!1}),a._knobChangedManually=!1,a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},h.Constants.EVENTS.ZOOM_DONE,a._onZoomDone),a.props.zoomDone&&Object(_.b)(function(){a._onZoomDone()}),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.SharedStateComponent),m(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._updateOnCanvasControls(),this._updatePositionsAndDimensions()}},{key:"sharedStateDidChange",value:function(e,t){this._operation&&t.operation&&this._operation!==t.operation&&this._operation.constructor===t.operation.constructor&&(t.operation.set(this._operation.serializeOptions()),this._operation=t.operation)}},{key:"_onZoomDone",value:function(){this.state.visible||(this.state.visible=!0),this._updateOnCanvasControls(),this._updatePositionsAndDimensions()}},{key:"_onCircleDragStart",value:function(){this._initialPosition=this.sharedState.radialFocus.position.clone(),this._initialKnobPosition=this.state.knobPosition.clone()}},{key:"_onCircleDrag",value:function(e){var t=this.context.editor,n=t.getOutputDimensions(),i=e.clone().divide(n),r=this._initialPosition.clone().add(i),o=this._initialKnobPosition.clone().add(e);this.sharedState.setPosition(r),this.state.knobPosition=o,t.render(),this._updatePositionsAndDimensions()}},{key:"_onKnobDragStart",value:function(e){this._knobChangedManually=!0,this._initialKnobPosition=this.state.knobPosition.clone()}},{key:"_onKnobDrag",value:function(e){var t=this.context.editor,n=t.getOutputDimensions(),i=this._initialKnobPosition.clone().add(e).clamp(new v(0,0),n),r=this.sharedState.radialFocus.position.clone().multiply(n),o=i.clone().subtract(r).abs().len(),a=o/2;this.setState({knobPosition:i,circleDimensions:new v(2*o,2*o)}),this.sharedState.setOperationOptions({radius:o/n.min(),gradientRadius:a/n.min()}),t.render()}},{key:"_updatePositionsAndDimensions",value:function(){var e=this.context.editor.getOutputDimensions(),t=this.sharedState.radialFocus.position.clone().multiply(e),n=this.sharedState.radialFocus.radius*e.min(),i=2*n,r={circleDimensions:new v(i,i),circlePosition:t};this._knobChangedManually||(r.knobPosition=t.clone().add(n,0)),this.setState(r)}},{key:"_updateOnCanvasControls",value:function(){var e=this.context.editor.getSDK().getSprite().getBounds(),t=this._container.getBoundingClientRect(),n=this.context.appComponent.getBounds(),i=new b(Math.floor(e.x-(t.left-n.left)),Math.floor(e.y-(t.top-n.top)),Math.ceil(e.width)+1,Math.ceil(e.height)+1);h.Utils.styleElement(this._onCanvasControls,{left:i.x+"px",top:i.y+"px",width:i.width+"px",height:i.height+"px"}),this.forceUpdate()}},{key:"_getCircleStyles",value:function(){return{width:this.state.circleDimensions.x,height:this.state.circleDimensions.y,left:this.state.circlePosition.x,top:this.state.circlePosition.y,marginLeft:-.5*this.state.circleDimensions.x,marginTop:-.5*this.state.circleDimensions.y}}},{key:"_getKnobStyle",value:function(){return{left:this.state.knobPosition.x,top:this.state.knobPosition.y}}},{key:"render",value:function(){var e=this;return h.React.createElement(w,{innerRef:function(t){e._container=t}},h.React.createElement(h.Transition,{active:this.state.visible,enterProp:"rendered",enterDuration:1e3*this.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*this.context.theme.transitionDuration,leaveDuration:1e3*this.context.theme.transitionDuration},h.React.createElement(S,{innerRef:function(t){e._onCanvasControls=t}},h.React.createElement(h.DraggableComponent,{onStart:this._onCircleDragStart,onDrag:this._onCircleDrag},h.React.createElement(E,{className:void 0,style:this._getCircleStyles()})),h.React.createElement(h.DraggableComponent,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag},h.React.createElement(C,{className:void 0,style:this._getKnobStyle()})))))}}]),t}();k.contextTypes=h.SharedStateComponent.contextTypes,t.a=k;var w=Object(h.adonis)(y).div("1rineb","CanvasControls"),S=h.adonis.div("12e79nm",{rendered:"2jlos",visible:"zgbg08"},"OnCanvasControls"),C=Object(h.adonis)(g).div("120drhm","Knob"),E=h.adonis.div("kgwi8g","Circle")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(15)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=h.ControlsStyles.Knob,y=h.ControlsStyles.FullContainer,v=d.Math.Vector2,b=d.Math.Rectangle,k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return a._bindAll("_onKnobDragStart","_onKnobDrag","_onZoomDone"),a.state=d.Utils.extend(a.state,{visible:!1}),a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},h.Constants.EVENTS.ZOOM_DONE,a._onZoomDone),a.props.zoomDone&&Object(_.b)(function(){a._onZoomDone()}),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.SharedStateComponent),m(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._updateOnCanvasControls()}},{key:"sharedStateDidChange",value:function(e,t){this._operation&&t.operation&&this._operation!==t.operation&&this._operation.constructor===t.operation.constructor&&(t.operation.set(this._operation.serializeOptions()),this._operation=t.operation)}},{key:"_onZoomDone",value:function(){this.state.visible||(this.state.visible=!0),this._updateOnCanvasControls()}},{key:"_onKnobDragStart",value:function(e,t){this._initialPosition=this.sharedState.linearFocus["controlPoint"+e]}},{key:"_onKnobDrag",value:function(e,t){var n=this.context.editor.getSDK().getSprite().getBounds(),i=this._container.getBoundingClientRect(),r=this.context.appComponent.getBounds(),o=this._initialPosition.clone().multiply(n.width,n.height).add(t).clamp(new v(i.left-r.left-n.x,i.top-r.top-n.y),new v(i.width-(n.x-(i.left-r.left)),i.height-(n.y-(i.top-r.top)))).divide(n.width,n.height);this.sharedState["setControlPoint"+e](o)}},{key:"_updateOnCanvasControls",value:function(){var e=this.context.editor.getSDK().getSprite().getBounds(),t=this._container.getBoundingClientRect(),n=this.context.appComponent.getBounds(),i=new b(Math.floor(e.x-(t.left-n.left)),Math.floor(e.y-(t.top-n.top)),Math.ceil(e.width)+1,Math.ceil(e.height)+1);h.Utils.styleElement(this._onCanvasControls,{left:i.x+"px",top:i.y+"px",width:i.width+"px",height:i.height+"px"}),this.forceUpdate()}},{key:"_getKnobStyle",value:function(e){var t=this.context.editor,n=this.sharedState.linearFocus["controlPoint"+e],i=t.getSDK().getSprite().getBounds(),r=n.clone().multiply(i.width,i.height);return{left:r.x,top:r.y}}},{key:"_getLineStyle",value:function(){var e=this.context.editor.getSDK().getSprite().getBounds(),t=this.sharedState.linearFocus.controlPoint1.clone(),n=this.sharedState.linearFocus.controlPoint2.clone(),i={1:t.multiply(e.width,e.height),2:n.multiply(e.width,e.height)},r=i[2].clone().subtract(i[1]),o=r.len(),a=Math.atan2(r.y,r.x);return{width:o+"px",left:i[1].x+"px",top:i[1].y+"px",transform:"rotate("+a+"rad) translateY(-50%)"}}},{key:"_renderKnobs",value:function(){for(var e=[],t=1;t<=2;t++)e.push(h.React.createElement(h.DraggableComponent,{onStart:this._onKnobDragStart.bind(this,t),onDrag:this._onKnobDrag.bind(this,t),key:t},h.React.createElement(C,{style:this._getKnobStyle(t),className:void 0})));return e}},{key:"render",value:function(){var e=this;return h.React.createElement(w,{innerRef:function(t){e._container=t}},h.React.createElement(h.Transition,{active:this.state.visible,enterProp:"rendered",enterDuration:1e3*this.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*this.context.theme.transitionDuration,leaveDuration:1e3*this.context.theme.transitionDuration},h.React.createElement(S,{innerRef:function(t){e._onCanvasControls=t}},this._renderKnobs(),h.React.createElement(E,{style:this._getLineStyle()}))))}}]),t}();k.contextTypes=h.SharedStateComponent.contextTypes,t.a=k;var w=Object(h.adonis)(y).div("1rineb","CanvasControls"),S=h.adonis.div("12e79nm",{rendered:"2jlos",visible:"zgbg08"},"OnCanvasControls"),C=Object(h.adonis)(g).div("120drhm","Knob"),E=h.adonis.div("1rrhaqy","Line")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(15)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=h.ControlsStyles.Knob,y=h.ControlsStyles.FullContainer,v=d.Math.Vector2,b=d.Math.Rectangle,k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return a._bindAll("_onCenterDragStart","_onCenterDrag","_onKnobDragStart","_onKnobDrag","_onZoomDone"),a.state=d.Utils.extend(a.state,{areaPosition:new v,areaDimensions:new v,knobPosition:new v,visible:!1}),a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},h.Constants.EVENTS.ZOOM_DONE,a._onZoomDone),a.props.zoomDone&&Object(_.b)(function(){a._onZoomDone()}),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.SharedStateComponent),m(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._updateOnCanvasControls(),this._updatePositionsAndDimensions()}},{key:"sharedStateDidChange",value:function(e,t){this._operation&&t.operation&&this._operation!==t.operation&&this._operation.constructor===t.operation.constructor&&(t.operation.set(this._operation.serializeOptions()),this._operation=t.operation)}},{key:"_onZoomDone",value:function(){this.state.visible||(this.state.visible=!0),this._updateOnCanvasControls(),this._updatePositionsAndDimensions()}},{key:"_onCenterDragStart",value:function(){this._initialStart=this.sharedState.mirroredFocus.start,this._initialEnd=this.sharedState.mirroredFocus.end,this._initialDist=this._initialEnd.clone().subtract(this._initialStart)}},{key:"_onCenterDrag",value:function(e){var t=this.context.editor.getOutputDimensions(),n=e.clone().divide(t),i=this._initialStart.clone().add(n).clamp(new v(0,0),new v(1,1).subtract(this._initialDist)),r=i.clone().add(this._initialDist);this.sharedState.setOperationOptions({start:i,end:r}),this._updatePositionsAndDimensions()}},{key:"_onKnobDragStart",value:function(e){this._initialKnobPosition=this.state.knobPosition.clone()}},{key:"_onKnobDrag",value:function(e){var t=this.context.editor.getOutputDimensions(),n=this._initialKnobPosition.clone().add(e).clamp(new v(0,0),t),i=n.clone().subtract(this.state.areaPosition),r=this.state.areaPosition.clone().add(-i.y,i.x).divide(t),o=this.state.areaPosition.clone().add(i.y,-i.x).divide(t),a=2*i.len();this.sharedState.setOperationOptions({start:r,end:o,size:a/t.min(),gradientSize:a/t.min()}),this.setState({knobPosition:n,areaDimensions:new v(this.state.areaDimensions.x,a)})}},{key:"_getAreaStyle",value:function(){var e=this.state.knobPosition.clone().subtract(this.state.areaPosition),t="rotate("+(-Math.atan2(e.x,e.y)*(180/Math.PI)).toFixed(2)+"deg)";return{width:this.state.areaDimensions.x,height:this.state.areaDimensions.y,left:this.state.areaPosition.x,top:this.state.areaPosition.y,marginLeft:-.5*this.state.areaDimensions.x,marginTop:-.5*this.state.areaDimensions.y,transform:t,MozTransform:t,msTransform:t,WebkitTransform:t}}},{key:"_getKnobStyle",value:function(){return{left:this.state.knobPosition.x,top:this.state.knobPosition.y}}},{key:"_updatePositionsAndDimensions",value:function(){var e=this.context.editor.getOutputDimensions(),t=this.sharedState.mirroredFocus,n=t.start,i=t.end,r=t.size;n=n.clone().multiply(e),i=i.clone().multiply(e),r*=e.min();var o=i.clone().subtract(n),a=n.clone().add(o.clone().divide(2)),s=new v(2*e.len(),r),l=o.len(),c=o.clone().divide(l).divide(2);this.setState({areaDimensions:s,areaPosition:a.clone(),knobPosition:a.clone().add(-r*c.y,r*c.x)})}},{key:"_updateOnCanvasControls",value:function(){var e=this.context.editor.getSDK().getSprite().getBounds(),t=this._container.getBoundingClientRect(),n=this.context.appComponent.getBounds(),i=new b(Math.floor(e.x-(t.left-n.left)),Math.floor(e.y-(t.top-n.top)),Math.ceil(e.width)+1,Math.ceil(e.height)+1);h.Utils.styleElement(this._onCanvasControls,{left:i.x+"px",top:i.y+"px",width:i.width+"px",height:i.height+"px"}),this.forceUpdate()}},{key:"render",value:function(){var e=this;return h.React.createElement(w,{innerRef:function(t){e._container=t}},h.React.createElement(h.Transition,{active:this.state.visible,enterProp:"rendered",enterDuration:1e3*this.context.theme.transitionDuration,appearProp:"visible",appearDuration:1e3*this.context.theme.transitionDuration,leaveDuration:1e3*this.context.theme.transitionDuration},h.React.createElement(S,{innerRef:function(t){e._onCanvasControls=t}},h.React.createElement(h.DraggableComponent,{onStart:this._onCenterDragStart,onDrag:this._onCenterDrag},h.React.createElement(E,{className:void 0,style:this._getAreaStyle()})),h.React.createElement(h.DraggableComponent,{onStart:this._onKnobDragStart,onDrag:this._onKnobDrag},h.React.createElement(C,{className:void 0,style:this._getKnobStyle()})))))}}]),t}();k.contextTypes=h.SharedStateComponent.contextTypes,t.a=k;var w=Object(h.adonis)(y).div("1rineb","CanvasControls"),S=h.adonis.div("aovk7s",{rendered:"2jlos",visible:"zgbg08"},"OnCanvasControls"),C=Object(h.adonis)(g).div("120drhm","Knob"),E=h.adonis.div("36haff","Area")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=n.n(f),d=n(360),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseControls),h(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];var t=e.get("frame")||null,n=null;return t&&(n=t.getFrame()),{operation:t,frame:n,frameIdentifier:n?n.identifier:null,tintColor:t?t.getTintColor():null,removeFrame:function(){t&&e.remove(t)},setTintColor:function(e){t&&t.setTintColor(e.clone())}}}},{key:"loadFrame",value:function(e){var t=this,n=this.context.editor,i=new f.Frame(this.context.ui,e),r=n.operations.getOrCreate("frame"),o=void 0,a=setTimeout(function(){o=f.ModalManager.instance.displayLoading(t._t("pesdk.common.text.loading"))},100);return i.load().then(function(){o&&o.close(),a&&(clearTimeout(a),a=null),r.setFrame(i.getFrame())})}}],[{key:"isEnabled",value:function(e){return e.isToolAllowed("frame")&&e.isToolEnabled("frame")}}]),t}();_.clickAtPosition=f.BaseControls.clickAtPosition,_.getPreloadAssets=f.BaseControls.getPreloadAssets,_.identifier="frame",_.controlsComponent=d.a,_.canvasControlsComponent=f.BaseControls.canvasControlsComponent,_.iconPath="editor/controls/frame/icon.png",_.activeIconPath="editor/controls/frame/icon-active.png",_.requiredOperations=["frame"],_.defaultOptions={categories:[],replaceCategories:!1,availableFrames:null},_.updatableOperations=["frame"],_.switchToDefaultControlsOnRemoval=!1,p.a.Controls.FrameControls=_,t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(361)),_=n(363),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g={ROOT:1,CATEGORY:2,OPTIONS:3},y=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onFrameClick","_onReplaceClick"),o._initFrameManager(),o._needsStyleFixes=!0,o.context.editor.getSDK().render();var a=g.ROOT,s=o.getSharedState("operation");return s&&s.getFrame()&&(a=g.OPTIONS),o.state={currentPanel:a},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),m(t,[{key:"fixStyles",value:function(){var e=this;return this._list.style.height="100%",function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"fixStyles",this).call(this).then(function(){if(d.Utils.Browser.isIElte(10)){var t=e._container.offsetHeight;e._list.style.height=t+"px"}return e.refs.panel.fixStyles()})}},{key:"componentDidUpdate",value:function(e,t){this.state.currentPanel!==t.currentPanel&&this.fixStyles()}},{key:"_initFrameManager",value:function(){this._frameManager=new d.FrameManager(this.context.ui,this.props.options)}},{key:"sharedStateDidChange",value:function(e,t){var n=this.context.editor.operations.get("frame");return!n||n&&!n.getFrame()?this.setState({currentPanel:g.ROOT}):this.setState({currentPanel:g.OPTIONS})}},{key:"_onReplaceClick",value:function(){this.setState({currentPanel:g.ROOT})}},{key:"_onCategoryClick",value:function(e){this.setState({currentPanel:g.CATEGORY,category:e})}},{key:"_onFrameClick",value:function(e){var t=this;if(!e)return this.sharedState.removeFrame(),void this.props.controls.addLocalHistorySnapshot("frame-image",!0);this.props.controls.loadFrame(e).then(function(){t.props.controls.addLocalHistorySnapshot("frame-image",!1),t.setState({currentPanel:g.OPTIONS})})}},{key:"_renderCurrentPanel",value:function(){var e=this,t=this.props.controls;switch(this.state.currentPanel){case g.ROOT:return d.React.createElement(h.a,{innerRef:function(t){e._list=t},frameManager:this._frameManager,onFrameClick:this._onFrameClick,controls:t,ref:"panel"});case g.OPTIONS:return d.React.createElement(_.a,{innerRef:function(t){e._list=t},frameManager:this._frameManager,onReplaceClick:this._onReplaceClick,onNewFrameClick:this._onNewFrameClick,controls:t,ref:"panel"})}}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){return this._renderCurrentPanel()}}]),t}();y.contextTypes=d.ControlsComponent.contextTypes,y.RootElement=d.ControlsComponent.RootElement,t.a=y},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(15)),_=n(362),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.BaseComponent),m(t,[{key:"fixStyles",value:function(){var e=this;return u.a.resolve().then(function(){d.Utils.Browser.isIElte(10)?Object(h.b)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.frameManager,i=t.innerRef;return d.React.createElement(y,{innerRef:function(t){i&&i(t),e._wrapper=t},className:void 0},d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement(_.a,{frames:n.getFramesForCategory("all"),onFrameClick:this.props.onFrameClick})))}}]),t}();g.contextTypes=d.BaseComponent.contextTypes,t.a=g;var y=d.adonis.div("rfecls","Wrapper")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.PlainControlItem,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.SharedStateComponent),p(t,[{key:"_onFrameClick",value:function(e){this.props.onFrameClick&&this.props.onFrameClick(e)}},{key:"_renderListItems",value:function(){var e=this,t=this.props.frames,n=this.getSharedState.frameIdentifier,i=this.getSharedState("selectedSprite");return i&&(n=i.getIdentifier()),t.map(function(t){var i={background:"url('"+e._getAssetPath(t.thumbnail)+"') no-repeat center center",backgroundSize:"contain"};return f.React.createElement(m,{selected:t.identifier===n,key:t.identifier,onClick:e._onFrameClick.bind(e,t),className:void 0,twoColumns:!0},f.React.createElement(g,{style:i}))})}},{key:"render",value:function(){var e=this.sharedState.frame;return f.React.createElement(_,null,f.React.createElement(m,{selected:!e,onClick:this._onFrameClick.bind(this,null),className:void 0,withText:!0,twoColumns:!0},this._t("pesdk.frame.button.none")),this._renderListItems())}}]),t}();h.contextTypes=f.SharedStateComponent.contextTypes,t.a=h;var _=f.adonis.ul("18qztam","FrameList"),m=Object(f.adonis)(d).li("u8nfgk","FrameListItem"),g=f.adonis.div("7r0ke8","FrameImage")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(15)),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=d.ControlsStyles.PlainControlItemBackground,g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onTintToggle","_onTintColorChange","_onOpacityChange","_onWidthChange");var a=null,s=i[0].controls._options;s&&s.colors&&(a=s.colors);var l=o.sharedState.tintColor;return o.state={tintEnabled:!!l&&l.a>0,tintColor:l,colorPalette:a},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),_(t,[{key:"_onTintToggle",value:function(e){var t=this.state.tintEnabled,n=this.sharedState.tintColor.clone();n.a=t?0:1,this.sharedState.setTintColor(n),this.props.controls.addLocalHistorySnapshot("frame-tint-enabled"),this.context.editor.render(),this.setState({tintEnabled:!t})}},{key:"_onTintColorChange",value:function(e){this.sharedState.setTintColor(e.clone()),this.props.controls.addLocalHistorySnapshot("frame-tint-color",!0),this.context.editor.render()}},{key:"sharedStateDidChange",value:function(){var e=this.sharedState.tintColor;this.setState({tintEnabled:!!e&&e.a>0,tintColor:e?e.clone():null})}},{key:"_onOpacityChange",value:function(e){this.getSharedState("operation").setAlpha(e/100),this.props.controls.addLocalHistorySnapshot("frame-opacity",!0),this.context.editor.render(),this.forceUpdate()}},{key:"_onWidthChange",value:function(e){var t=this.context.editor,n=this.getSharedState("operation"),i=n.getInputDimensions().min();n.setScale(e/i),this.props.controls.addLocalHistorySnapshot("frame-width",!0),t.render(),this.forceUpdate()}},{key:"fixStyles",value:function(){var e=this;return u.a.resolve().then(function(){d.Utils.Browser.isIElte(10)?Object(h.b)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.innerRef,i=t.onReplaceClick,r=this.getSharedState("operation"),o=r.getFrame(),a=r.getInputDimensions().min(),s=o.tintable,l={background:"url('"+this._getAssetPath(o.thumbnail,!1)+"') center center / contain no-repeat"};return d.React.createElement(y,{innerRef:function(t){n&&n(t),e._wrapper=t},className:void 0},d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement("div",null,d.React.createElement(v,null,d.React.createElement(b,null,d.React.createElement(k,null,d.React.createElement(w,{style:l,onClick:i})),d.React.createElement(S,null,d.React.createElement(C,null,this._t("pesdk.frame.asset."+o.identifier)||o.defaultName),d.React.createElement(E,{onClick:i,className:void 0},this._t("pesdk.frame.button.replace")))),d.React.createElement(d.SliderControlComponent,{minValue:0,value:Math.round(100*r.getAlpha()),maxValue:100,label:this._t("pesdk.frame.title.opacity"),onSliderValueChange:this._onOpacityChange,onValueChange:this._onOpacityChange,middleDot:!1,className:void 0}),d.React.createElement(d.SliderControlComponent,{minValue:.05*a,value:Math.round(r.getScale()*a),maxValue:.3*a,label:this._t("pesdk.frame.title.width"),onSliderValueChange:this._onWidthChange,onValueChange:this._onWidthChange,middleDot:!1,className:void 0})),s&&d.React.createElement(d.CollapseSectionComponent,{toggleable:!0,title:this._t("pesdk.frame.button.fill"),expanded:this.state.tintEnabled,className:void 0,onToggle:this._onTintToggle},d.React.createElement(x,{value:this.state.tintColor,colorPalette:this.state.colorPalette,onColorPickerToggle:this.fixStyles,onChange:this._onTintColorChange})))))}}]),t}();g.contextTypes=d.SharedStateComponent.contextTypes,t.a=g;var y=d.adonis.div("rfecls","Wrapper"),v=d.adonis.div("1vnvjau","TopSection"),b=d.adonis.div("16woy02","Details"),k=Object(d.adonis)(m).div("6u8g0p","Thumbnail"),w=d.adonis.div("7r0ke8","ThumbnailImage"),S=d.adonis.div("1trlo6v","DetailsContainer"),C=d.adonis.div("w9mc0y","Title"),E=d.adonis.div("1rhky7p","ReplaceButton"),x=Object(d.adonis)(d.ColorSelectionComponent)("1ouwzwk","ColorSelection")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=n.n(f),d=n(365),h=n(25),_=n(60),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseControls),m(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];var t=e.getOrCreate("overlay");return{operation:t,identifier:t?t.getIdentifier():null,alpha:t?t.getAlpha():1,blendMode:t?t.getBlendMode():_.a.normal,removeOverlay:function(){t&&t.set({image:null,identifier:null,alpha:1})},setOverlayOptions:function(e){t&&t.set(e)},setAlpha:function(e){t&&t.setAlpha(e)},setBlendMode:function(e){t&&t.setBlendMode(e)}}}},{key:"loadOverlay",value:function(e){var t=this,n=this._getAssetPath(e.image),i=_.a[e.blendMode],r=void 0,o=setTimeout(function(){r=f.ModalManager.instance.displayLoading(t._t("pesdk.common.text.loading"))},100);return h.a.load(n).then(function(t){return r&&r.close(),o&&(clearTimeout(o),o=null),{identifier:e.identifier,image:t,blendMode:i,alpha:void 0===e.intensity?1:e.intensity}})}}],[{key:"isEnabled",value:function(e){return e.isToolAllowed("overlay")&&e.isToolEnabled("overlay")}}]),t}();g.clickAtPosition=f.BaseControls.clickAtPosition,g.getPreloadAssets=f.BaseControls.getPreloadAssets,g.identifier="overlay",g.controlsComponent=d.a,g.canvasControlsComponent=f.BaseControls.canvasControlsComponent,g.iconPath="editor/controls/overlay/icon.png",g.activeIconPath="editor/controls/overlay/icon-active.png",g.requiredOperations=["overlay"],g.defaultOptions={overlays:[],replaceOverlays:!1,availableOverlays:null},g.updatableOperations=["overlay"],g.switchToDefaultControlsOnRemoval=!1,p.a.Controls.OverlayControls=g,t.a=g},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(25)),_=n(89),m=n(366),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},v=d.ControlsStyles.PlainControlItem,b=d.ControlsStyles.PlainControlItemBackground,k=d.ControlsStyles.ControlItemTitle,w=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i))),a=o.context,s=a.ui,l=a.theme;return o._thumbnailLoadQueue=new _.a(1,1/0,l.listItemSlideInDelay),o._thumbnailsLoaded={},o._overlayManager=new d.OverlayManager(s,o.props.options),o.state={},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),g(t,[{key:"componentDidMount",value:function(){y(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._loadThumbnails()}},{key:"componentWillUnmount",value:function(){y(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),this._thumbnailLoadQueue.dispose()}},{key:"_loadThumbnails",value:function(){var e=this;this._overlayManager.getOverlays().forEach(function(t){e._thumbnailLoadQueue.add(function(){return h.a.load(e._getAssetPath(t.thumbnail)).then(function(n){e._thumbnailsLoaded[t.identifier]=n,e.forceUpdate()})})})}},{key:"_onBlendModeChange",value:function(){this.props.controls.addLocalHistorySnapshot("overlay-blend-mode",!1)}},{key:"_onAlphaChange",value:function(){this.props.controls.addLocalHistorySnapshot("overlay-alpha",!0)}},{key:"_onItemClick",value:function(e){var t=this;if(!e)return this.sharedState.removeOverlay(),this.forceUpdate();e.identifier!==this.sharedState.identifier&&this.props.controls.loadOverlay(e).then(function(e){t.sharedState.setOverlayOptions(e),t.props.controls.addLocalHistorySnapshot("overlay-image",!1)})}},{key:"_renderListItems",value:function(){var e=this,t=this.sharedState.identifier;return this._overlayManager.getOverlays().map(function(n){return d.React.createElement(m.a,{key:n.identifier,overlay:n,selected:n.identifier===t,visible:!!e._thumbnailsLoaded[n.identifier],onClick:e._onItemClick.bind(e,n),onBlendModeChange:e._onBlendModeChange.bind(e),onAlphaChange:e._onAlphaChange.bind(e)})})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this,t=!this.getSharedState("operation").getIdentifier();return d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement(S,null,d.React.createElement(C,{onClick:this._onItemClick.bind(this,null)},d.React.createElement(E,{selected:t},d.React.createElement(x,null,this._t("pesdk.overlay.button.none")))),this._renderListItems()))}}]),t}();w.contextTypes=d.ControlsComponent.contextTypes,w.propTypes=d.ControlsComponent.propTypes,w.RootElement=d.ControlsComponent.RootElement,t.a=w;var S=d.adonis.ul("9uviv9","List"),C=Object(d.adonis)(v).div("1sgdmny","NoneItem"),E=Object(d.adonis)(b).div("yogtp1","NoneItemBackground"),x=Object(d.adonis)(k).span("5krmrh","ItemTitle")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(367)),_=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=d.ControlsStyles.ControlItem,y=d.ControlsStyles.ControlItemActiveOverlay,v=d.ControlsStyles.ControlItemTitle,b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.state={hovered:!1},o._bindAll("_onBlendModeChange","_onAlphaChange"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),m(t,[{key:"_onBlendModeChange",value:function(e){this.props.onBeforeBlendModeChange&&this.props.onBeforeBlendModeChange(),this.sharedState.setBlendMode(e),this.props.onBlendModeChange&&this.props.onBlendModeChange()}},{key:"_onAlphaChange",value:function(e){this.props.onBeforeAlphaChange&&this.props.onBeforeAlphaChange(),this.sharedState.setAlpha(e),this.props.onAlphaChange&&this.props.onAlphaChange()}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.selected!==e.selected||this.props.visible!==e.visible||this.state.hovered!==t.hovered||this.props.overlay!==e.overlay||!(this.props.intensity===e.intensity||!e.selected)}},{key:"render",value:function(){var e=this,t=this.props,n=t.lastChild,i=t.onClick,r=t.selected,o=t.visible,a=t.overlay,s=this.sharedState.alpha,l=this.sharedState.blendMode,c={lastChild:n,onClick:i,visible:o};return c.style={backgroundImage:"url('"+this._getAssetPath(a.thumbnail)+"')"},d.React.createElement(k,_({},c,{className:void 0,animated:!0,innerRef:function(t){e._container=t},onMouseEnter:function(){return e.setState({hovered:!0})},onMouseLeave:function(){return e.setState({hovered:!1})}}),d.React.createElement(S,{selected:r},d.React.createElement(d.Transition,{active:!r},d.React.createElement(x,null,d.React.createElement(C,{hovered:this.state.hovered},this._t("pesdk.overlay.asset."+a.identifier)||a.defaultName))),d.React.createElement(d.Transition,{active:r},d.React.createElement(x,null,d.React.createElement(E,null,this._t("pesdk.overlay.title.blending")),d.React.createElement(O,{value:l,onChange:this._onBlendModeChange}),r&&d.React.createElement(w,null,d.React.createElement(d.SliderComponent,{minValue:0,maxValue:1,valueUnit:"",middleDot:!1,value:s,onChange:this._onAlphaChange})),d.React.createElement(T,{rendered:!0,visible:!0})))))}},{key:"container",get:function(){return this._container}}]),t}();b.contextTypes=d.SharedStateComponent.contextTypes,t.a=b;var k=Object(d.adonis)(g).div("193vjnw",{lastChild:"229bd5"},"Item"),w=d.adonis.div("12dmntm","Slider"),S=d.adonis.div("1m161zg","ItemContainer"),C=Object(d.adonis)(v).span("120drhm","ItemTitle"),E=Object(d.adonis)(C)("1kbikta","BlendingLabel"),x=d.adonis.div("tj7k39",{rendered:"cuo4v2",visible:"82svov"},"ItemContent"),T=Object(d.adonis)(y).div("120drhm","Overlay"),O=Object(d.adonis)(h.a)("ii685b","BlendingControl")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(43),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(60)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=h.ControlsStyles.ControlItemTitle,y=d.Utils.flipObject(_.a),v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onPreviousClick","_onNextClick"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.BaseComponent),m(t,[{key:"_onPreviousClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=u()(y),n=(t.indexOf(this.props.value.toString())+t.length-1)%t.length,i=parseInt(t[n],10);this.props.onChange&&this.props.onChange(i)}},{key:"_onNextClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=u()(y),n=(t.indexOf(this.props.value.toString())+t.length+1)%t.length,i=parseInt(t[n],10);this.props.onChange&&this.props.onChange(i)}},{key:"render",value:function(){var e={backgroundImage:"url('"+this._getAssetPath("editor/controls/overlay/arrow-left.png",!0)+"')"},t={backgroundImage:"url('"+this._getAssetPath("editor/controls/overlay/arrow-right.png",!0)+"')"},n=this.props.value;return h.React.createElement(b,{styles:this.props.styles},h.React.createElement(w,{onClick:this._onPreviousClick,style:e}),h.React.createElement(k,null,this._t("pesdk.overlay.title."+y[n])),h.React.createElement(w,{onClick:this._onNextClick,style:t}))}}]),t}();v.contextTypes=h.BaseComponent.contextTypes,t.a=v;var b=h.adonis.div("15zte1z","BlendingControlContainer");v.RootElement=b;var k=Object(h.adonis)(g).div("1v7ogyl","Label"),w=h.adonis.div("1v32l0l","Arrow")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=n.n(h),m=n(369),g=n(374),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=d.Math.Vector2,b=void 0;d.Operations.SpriteOperation&&(b=d.Operations.SpriteOperation.StickerSprite);var k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._updateStickerCategories=o._updateStickerCategories.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.BaseControls),y(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.getOrCreate("sprite"),i=n.getInputDimensions(!1),r=t.selectedSprite,o=t.stickerManager;if(r&&n.getSprites().indexOf(r)<0){var a=n.getSprites().filter(function(e){return e.getId()===r.getId()})[0];a&&(r=a)}return{operation:n,inputDimensions:i,stickerManager:o,selectedSprite:r,stickerObject:r&&o?o.getStickerByIdentifier(r.getIdentifier()):null,image:r?r.getImage():null,alpha:r?100*r.getAlpha():0,tintMode:r?r.getTintMode():"",tintColor:r?r.getTintColor():null,setStickerOptions:function(e){r&&r.set(e)},setStickerImage:function(e){r&&r.setImage(e)},setAlpha:function(e){r&&r.setAlpha(e/100)},setTintMode:function(e){r&&r.setTintMode(e)},setTintColor:function(e){r&&r.setTintColor(e)}}}},{key:"createSticker",value:function(e){var t=this;return this.loadStickerImage(e).then(function(n){var i=t.context.editor.operations.getOrCreate("sprite"),r=i.getInputDimensions(!1),o=new v(n.width,n.height),a=new v(.5*r.min(),.5*r.min()),s=i.createSticker({identifier:e.identifier,image:n,position:new v(.5,.5),dimensions:d.Utils.resizeVectorToFit(o,a),rotation:0,smoothDownscaling:t._options.smoothDownscaling,resizeMode:e.resizeMode||"keepAspect"});return t.sharedState.set({selectedSprite:s}),i.addSprite(s),t.addLocalHistorySnapshot("sticker-creation",!1),s})}},{key:"loadStickerImage",value:function(e){var t=this;return new u.a(function(n,i){var r=e.images.mediaBase,o=h.StickerManager.getURLForSticker(e,"base"),a=r.rawData?r.uris[0]:t._getAssetPath(o),s=new window.Image,l=void 0,c=setTimeout(function(){l=h.ModalManager.instance.displayLoading(t._t("pesdk.common.text.loading"))},100);s.addEventListener("load",function(){l&&l.close(),c&&(clearTimeout(c),c=null),void 0!==r.width&&void 0!==r.height&&(s.width=r.width,s.height=r.height),n(s)}),s.addEventListener("error",function(){l&&l.close(),c&&(clearTimeout(c),c=null),h.ModalManager.instance.displayError(t._t("pesdk.common.title.error"),t._t("pesdk.sticker.text.stickerLoadingError",{path:s.src})),i(new Error("Loading sticker failed"))}),s.crossOrigin=t.context.editor.getCrossOrigin(),s.src=a})}},{key:"isCustomStickerUploadEnabled",value:function(){return!this._options.customUploadDisabled}},{key:"addCustomStickerFromImage",value:function(e,t){var n=h.ModalManager.instance.displayLoading(this._t("pesdk.common.text.loading")),i=this._options.customStickerTintMode||"none",r=t.replace(/\.[\w]*$/,"");this.sharedState.get("stickerManager").addCustomStickerFromImage(e,r,i),n&&n.close()}},{key:"_updateStickerCategories",value:function(e){var t=this._options,n=t.categories,i=t.replaceCategories,r=t.availableStickers;e||(e=n);var o=new h.StickerManager(this.context.ui,{categories:e,replaceCategories:i,availableStickers:r},this.context.editor.getDynamicAssetsLibrary());this.sharedState.set({stickerManager:o})}},{key:"_onEnter",value:function(){var e=this.context.editor;this._updateStickerCategories(),this._mediator.on(h.Constants.EVENTS.ADDED_STICKER,this._updateStickerCategories),e.zoom.auto(),e.features.disable("zoom","drag")}},{key:"_onLeave",value:function(){var e=this.context.editor;this._mediator.off(h.Constants.EVENTS.ADDED_STICKER,this._updateStickerCategories),e.features.enable("zoom","drag"),e.render()}}],[{key:"clickAtPosition",value:function(e,t){var n=t.operations.get("sprite");if(!n)return!1;var i=n.getSpritesAtPosition(e,t.getOutputTextureDimensions()).filter(function(e){return e instanceof b});return!!i[0]&&{selectedSprite:i[0]}}},{key:"getPreloadAssets",value:function(e){return["editor/controls/shared/canvas-overlay-controls/to-front.png","editor/controls/shared/canvas-overlay-controls/duplicate.png","editor/controls/shared/canvas-overlay-controls/delete.png"]}},{key:"isEnabled",value:function(e){return e.isToolAllowed("sticker")&&e.isToolEnabled("sticker")}}]),t}();k.identifier="sticker",k.controlsComponent=m.a,k.canvasControlsComponent=g.a,k.iconPath="editor/controls/sticker/icon.png",k.activeIconPath="editor/controls/sticker/icon-active.png",k.requiredOperations=["sprite"],k.defaultOptions={categories:[],replaceCategories:!1,availableStickers:null},k.updatableOperations=["sprite"],k.switchToDefaultControlsOnRemoval=!0,_.a.Controls.StickerControls=k,t.a=k},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(7),m=(n.n(_),n(5)),g=(n.n(m),n(370)),y=n(372),v=n(373),b=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},k=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),w=_.Math.Vector2,S={ROOT:1,CATEGORY:2,OPTIONS:3},C=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onCategoryClick","_onStickerClick","_onBackClick","_onNewStickerClick","_onReplaceClick","_onStickerDeselected"),o._events=b({},o._events,function(e,t,n){return t in e?a()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},m.Constants.EVENTS.SPRITES_DESELECTED,o._onStickerDeselected)),o._needsStyleFixes=!0;var s=S.ROOT;return o.sharedState.selectedSprite&&(s=S.OPTIONS),o.state.currentPanel=s,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,m.ControlsComponent),k(t,[{key:"fixStyles",value:function(){var e=this;return this._list.style.height="100%",function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"fixStyles",this).call(this).then(function(){if(m.Utils.Browser.isIElte(10)){var t=e._container.offsetHeight;e._list.style.height=t+"px"}return e.refs.panel.fixStyles()})}},{key:"componentDidUpdate",value:function(e,t){this.state.currentPanel!==t.currentPanel&&this.fixStyles()}},{key:"sharedStateDidChange",value:function(e,t){e.stickerObject!==t.stickerObject&&t.selectedSprite&&t.stickerObject&&this.setState({currentPanel:S.OPTIONS})}},{key:"_onReplaceClick",value:function(){this.setState({currentPanel:S.ROOT})}},{key:"_onNewStickerClick",value:function(e){this.state.currentPanel=S.ROOT,this.setSharedState({selectedSprite:null}),e.preventDefault()}},{key:"_onCategoryClick",value:function(e){this.setState({currentPanel:S.CATEGORY,category:e})}},{key:"_onBackClick",value:function(e){e.preventDefault(),this.setState({currentPanel:S.ROOT})}},{key:"_onStickerClick",value:function(e){var t=this,n=this.sharedState.selectedSprite,i=function(){t.setState({currentPanel:S.OPTIONS})},r=this.context.editor;n?this.props.controls.loadStickerImage(e).then(function(o){var a=n.getDimensions().clone().max(),s=new w(a,a),l=new w(o.width,o.height),c={image:o,identifier:e.identifier,dimensions:_.Utils.resizeVectorToFit(l,s),resizeMode:e.resizeMode||"keepAspect"};"none"!==n.getTintMode()&&n.setTintMode(e.tintMode||"none"),t.sharedState.setStickerOptions(c),t.sharedState.setStickerImage(o),t.props.controls.addLocalHistorySnapshot("sticker-image",!0),r.render(),i()}):this.props.controls.createSticker(e).then(function(e){i()})}},{key:"_onStickerDeselected",value:function(){this.setState({currentPanel:S.ROOT})}},{key:"_onStickerUploaded",value:function(e,t){this.props.controls.addCustomStickerFromImage(e,t),this.state.currentPanel=S.CATEGORY,this.state.category=this.sharedState.stickerManager.getCategory("imgly_sticker_custom"),this.forceUpdate()}},{key:"_renderCurrentPanel",value:function(){var e=this,t=this.props.controls,n=this.sharedState.stickerManager;switch(this.state.currentPanel){case S.ROOT:return m.React.createElement(g.a,{innerRef:function(t){e._list=t},stickerManager:n,stickerUploadEnabled:this.props.controls.isCustomStickerUploadEnabled(),onStickerUpload:function(t,n){return e._onStickerUploaded(t,n)},onCategoryClick:this._onCategoryClick,onStickerClick:this._onStickerClick,controls:t,defaultCategory:this.props.options.defaultCategory||"all",ref:"panel"});case S.CATEGORY:return m.React.createElement(y.a,{innerRef:function(t){e._list=t},category:this.state.category,stickerManager:n,onBackClick:this._onBackClick,onStickerClick:this._onStickerClick,controls:t,ref:"panel"});case S.OPTIONS:return m.React.createElement(v.a,{innerRef:function(t){e._list=t},stickerManager:n,onReplaceClick:this._onReplaceClick,onNewStickerClick:this._onNewStickerClick,controls:t,ref:"panel"})}}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){return this._renderCurrentPanel()}}]),t}();C.contextTypes=m.ControlsComponent.contextTypes,C.RootElement=m.ControlsComponent.RootElement,t.a=C},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(371)),_=n(151),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.state={category:o.props.defaultCategory||"all"},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.BaseComponent),m(t,[{key:"_onCategoryClick",value:function(e,t){this.props.onCategoryClick&&this.props.onCategoryClick(e)}},{key:"_onStickerUploaded",value:function(e,t){this.props.onStickerUpload&&this.props.onStickerUpload(e,t)}},{key:"fixStyles",value:function(){var e=this;return u.a.resolve().then(function(){d.Utils.Browser.isIElte(10)?Object(d.requestAnimationFrame)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"_renderListItems",value:function(){var e=this;return this.props.stickerManager.getCategories().map(function(t){return d.React.createElement(h.a,{key:t.identifier,category:t,onClick:e._onCategoryClick.bind(e,t)})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.stickerManager,i=t.innerRef;return d.React.createElement(y,{innerRef:function(t){i&&i(t),e._wrapper=t},className:void 0},d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},this.props.stickerUploadEnabled&&d.React.createElement(v,null,d.React.createElement(d.InvisibleUploadComponent,{ref:"upload",acceptsMultiple:!0,onNewFile:function(t,n){return e._onStickerUploaded(t,n)}}),d.React.createElement(d.ButtonComponent,{title:this._t("pesdk.sticker.button.upload"),className:void 0,onClick:function(){return e.refs.upload.open()}})),d.React.createElement(b,null,this._renderListItems()),d.React.createElement(_.a,{stickers:n.getStickersForCategory(this.state.category),onStickerClick:this.props.onStickerClick})))}}]),t}();g.contextTypes=d.BaseComponent.contextTypes,t.a=g;var y=d.adonis.div("rfecls","Wrapper"),v=d.adonis.div("7abnmv","SectionListHeader"),b=d.adonis.ul("5jg0ou","CategoryList")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.ControlItem,h=f.ControlsStyles.ControlItemTitle,_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"render",value:function(){var e=this.props.category,t=e.metaData.backgroundImage;return e.metaData.rawData||(t=this._getAssetPath(t)),f.React.createElement(m,{onClick:this.props.onClick,className:void 0},f.React.createElement(g,{src:t}),f.React.createElement(v,null,this._t("pesdk.sticker.asset."+e.identifier)||e.defaultName),f.React.createElement(y,null))}}]),t}();_.contextTypes=f.BaseComponent.contextTypes,t.a=_;var m=Object(f.adonis)(d).li("1dc04zg","StickerCategoryItem"),g=f.adonis.img("ugq8dv","BackgroundImage"),y=f.adonis.div("1fxaw8w","Gradient"),v=Object(f.adonis)(h).div("120drhm","Title")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(151)),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),m=d.ControlsStyles.ControlItemTextStyles,g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.BaseComponent),_(t,[{key:"fixStyles",value:function(){var e=this;return u.a.resolve().then(function(){d.Utils.Browser.isIElte(10)?Object(d.requestAnimationFrame)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.stickerManager,i=t.category,r=t.onBackClick,o=t.onStickerClick,a=t.innerRef,s={height:"0px",boxShadow:"none"};"imgly_sticker_custom"!==i.identifier&&(s={backgroundImage:"url('"+this._getAssetPath(i.metaData.backgroundImage)+"')",backgroundSize:"cover"});var l={backgroundImage:"url('"+this._getAssetPath("editor/controls/shared/back.png",!0)+"')"},c=n.getStickersForCategory(i.identifier);return d.React.createElement(y,{innerRef:function(e){return a&&a(e)},className:void 0},d.React.createElement(v,{style:s},d.React.createElement(b,null,d.React.createElement(w,null,this._t("pesdk.sticker.asset."+i.identifier)||i.defaultName),i.metaData.author&&d.React.createElement(S,null,d.React.createElement("span",null,"by "),i.metaData.author),d.React.createElement(C,{style:l,onClick:r.bind(this),className:void 0}))),d.React.createElement(k,{innerRef:function(t){e._wrapper=t}},d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement(h.a,{stickers:c,onStickerClick:o}))))}}]),t}();g.contextTypes=d.BaseComponent.contextTypes,t.a=g;var y=d.adonis.div("iauaz2","StickerCategoryPanel"),v=d.adonis.div("1w3j3fe","Header"),b=d.adonis.div("3wd3qf","HeaderContent"),k=d.adonis.div("zb78lb","Content"),w=Object(d.adonis)(m).div("kswtk0","Title"),S=Object(d.adonis)(m).div("1qn5s6u","Subtitle"),C=d.adonis.button("1t2nim8","BackButton")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(8),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),_=d.ControlsStyles.PlainControlItemBackground,m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onTintToggle","_onTintColorChange","_onOpacityChange");var a=null,s=i[0].controls._options;return s&&s.colors&&(a=s.colors),o.state={colorPalette:a},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),h(t,[{key:"_getStickerObject",value:function(){return this.sharedState.stickerObject}},{key:"_onChangedOption",value:function(e,t){e&&this.props.controls.addLocalHistorySnapshot(e,t),this.context.editor.render()}},{key:"_onOpacityChange",value:function(e){this.sharedState.setAlpha(e),this._onChangedOption("sticker-opacity",!0)}},{key:"_onTintToggle",value:function(e){var t=this._getStickerObject();this.sharedState.setTintMode(e?t.tintMode:"none"),this._onChangedOption("sticker-tint-toggle",!0)}},{key:"_onTintColorChange",value:function(e){this.sharedState.setTintColor(e.clone()),this._onChangedOption("sticker-tint",!0)}},{key:"fixStyles",value:function(){var e=this;return u.a.resolve().then(function(){d.Utils.Browser.isIElte(10)?Object(d.requestAnimationFrame)(function(){e._scrollbar.update()}):e._scrollbar.update()})}},{key:"render",value:function(){var e=this,t=this.props,n=t.innerRef,i=t.onNewStickerClick,r=t.onReplaceClick,o=this.sharedState,a=o.alpha,s=o.tintMode,l=o.tintColor,c=o.selectedSprite;if(!c)return null;var u=this._getStickerObject(),f=this.context.editor.getCrossOrigin(),p=!!u.tintMode&&"none"!==u.tintMode;return d.React.createElement(g,{innerRef:function(t){n&&n(t),e._wrapper=t},className:void 0},d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement("div",null,d.React.createElement(y,null,d.React.createElement(d.ButtonComponent,{title:this._t("pesdk.sticker.button.new"),className:void 0,onClick:i}),d.React.createElement(v,null,d.React.createElement(b,null,d.React.createElement(k,{crossOrigin:f,onClick:r,src:c.getImage().src})),d.React.createElement(w,null,d.React.createElement(S,null,this._t("pesdk.sticker.asset."+u.identifier)||u.defaultName),d.React.createElement(C,{onClick:r,className:void 0},this._t("pesdk.sticker.button.replace")))),d.React.createElement(d.SliderControlComponent,{minValue:0,value:Math.round(a),maxValue:100,label:this._t("pesdk.sticker.title.opacity"),onSliderValueChange:this._onOpacityChange,onValueChange:this._onOpacityChange,middleDot:!1,className:void 0})),p&&d.React.createElement(d.CollapseSectionComponent,{toggleable:!0,title:this._t("pesdk.sticker.button.fill"),expanded:"none"!==s,className:void 0,onToggle:this._onTintToggle},d.React.createElement(E,{value:l,colorPalette:this.state.colorPalette,onColorPickerToggle:this.fixStyles,onChange:this._onTintColorChange})))))}}]),t}();m.contextTypes=d.SharedStateComponent.contextTypes,t.a=m;var g=d.adonis.div("rfecls","Wrapper"),y=d.adonis.div("1vnvjau","TopSection"),v=d.adonis.div("aqfteq","Details"),b=Object(d.adonis)(_).div("6u8g0p","Thumbnail"),k=d.adonis.img("wupchq","ThumbnailImage"),w=d.adonis.div("1trlo6v","DetailsContainer"),S=d.adonis.div("w9mc0y","Title"),C=d.adonis.div("1rhky7p","ReplaceButton"),E=Object(d.adonis)(d.ColorSelectionComponent)("1ouwzwk","ColorSelection")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(58)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=void 0;d.Operations.SpriteOperation&&(g=d.Operations.SpriteOperation.StickerSprite);var y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,_.a),m(t,[{key:"_renderSpriteItems",value:function(e){return function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0}(t.prototype.__proto__||p()(t.prototype),"_renderSpriteItems",this).call(this,e.filter(function(e){return e instanceof g}))}},{key:"_selectNextSprite",value:function(){for(var e=this.getSharedState("operation").getSprites().slice(0).reverse(),t=void 0,n=void 0,i=0;i<e.length;i++)if((t=e[i])instanceof g){n=t;break}n||(this.props.controls.skipHistory=!0,this.context.mediator.emit(h.Constants.EVENTS.SPRITES_DESELECTED)),this.setSharedState({selectedSprite:n}),this.context.screen.refreshControlsComponent()}},{key:"_createSprite",value:function(e){return this.getSharedState("operation").createSticker(e)}}]),t}();y.contextTypes=_.a.contextTypes,t.a=y},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=n.n(h),m=n(376),g=n(379),y=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=d.Math.Vector2,k=void 0,w=void 0;d.Operations.SpriteOperation&&(k=d.Operations.SpriteOperation.TextSprite,w=d.Operations.SpriteOperation.BrushSprite);var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||p()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,h.BaseControls),v(t,[{key:"mapOperationsToSharedState",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),i=e.getOrCreate("sprite"),r=i.getInputDimensions(),o=n.selectedSprite;if(o&&i.getSprites().indexOf(o)<0){var a=i.getSprites().filter(function(e){return e.getId()===o.getId()})[0];a&&(o=a)}return{operation:i,selectedSprite:o,inputDimensions:r,color:o?o.getColor().clone():null,backgroundColor:o?o.getBackgroundColor().clone():null,alignment:o?o.getAlignment():null,lineHeight:o?o.getLineHeight():0,fontFamily:o?o.getFontFamily():null,setFontSize:function(e){var n=e/r.min();o&&o.setFontSize(n),t.updateGlobalToolState({fontSize:n})},setColor:function(e){o&&o.setColor(e.clone()),t.updateGlobalToolState({color:e.clone()})},setBackgroundColor:function(e){o&&o.setBackgroundColor(e.clone()),t.updateGlobalToolState({backgroundColor:e.clone()})},setCharacterSpacing:function(e){o&&o.setCharacterSpacing(e),t.updateGlobalToolState({characterSpacing:e})},setLineHeight:function(e){o&&o.setLineHeight(e),t.updateGlobalToolState({lineHeight:e})},setAlignment:function(e){o&&o.setAlignment(e),t.updateGlobalToolState({alignment:e})},setTextOptions:function(e){o&&o.set(e),t.updateGlobalToolState(e)},setVariation:function(e){var n={fontIdentifier:e.getIdentifier(),fontFamily:e.getFontFamily(),fontWeight:e.getFontWeight(),fontStyle:e.getFontStyle(),textMetrics:e.getTextMetrics()};o&&o.set(n),t.updateGlobalToolState(n)}}}},{key:"createText",value:function(){var e=this.context.editor;this.saveTextSettings();var t=this.sharedState.get("operation"),n=this.sharedState.get("fontManager"),i=e.getOutputDimensions(),r=e.getSDK().getRenderer().getMaxTextureSize(),o=this.getGlobalToolState(),a=o?n.getVariationByIdentifier(o.fontIdentifier):n.getDefaultVariation(),s=t.createText(y({text:this.context.ui.translate("pesdk.text.placeholder.defaultText"),position:new b(.5,.5),maxWidth:.5,maxHeight:r?r/i.y:3,textMetrics:a.getTextMetrics(),fontIdentifier:a.getIdentifier(),fontSize:.08,fontFamily:a.getFontFamily(),fontWeight:a.getFontWeight(),fontStyle:a.getFontStyle(),color:d.Color.WHITE,alignment:"center"},o||{}));return this.sharedState.set({selectedSprite:s}),t.addSprite(s),this.addLocalHistorySnapshot(),s}},{key:"getCurrentFontVariation",value:function(){var e=this.sharedState.get("fontManager");if(this.sharedState.selectedSprite)return e.getVariationByIdentifier(this.sharedState.selectedSprite.getFontIdentifier());var t=this.getGlobalToolState();return t?e.getVariationByIdentifier(t.fontIdentifier):e.getDefaultVariation()}},{key:"getCurrentLineHeight",value:function(){return this.getGlobalToolState().lineHeight||1.1}},{key:"getCurrentAlignment",value:function(){return this.getGlobalToolState().alignment||"center"}},{key:"getCurrentFontSize",value:function(){var e=this.sharedState.selectedSprite;return e?e.getFontSize():this.getGlobalToolState().fontSize}},{key:"saveSpriteOptions",value:function(){this.saveTextSettings()}},{key:"saveTextSettings",value:function(){var e=this.sharedState.get("selectedSprite");e&&this.setGlobalToolState(e.serializeOptions(["color","backgroundColor","characterSpacing","lineHeight","alignment","fontIdentifier","fontSize","fontFamily","fontWeight","fontStyle"]))}},{key:"_onEnter",value:function(){var e=this.context.editor,t=this._options,n=t.fonts,i=t.replaceFonts,r=t.availableVariations,o=new h.FontManager(this.context.ui,{fonts:n,replaceFonts:i,availableVariations:r});this.sharedState.set({fontManager:o}),e.features.disable("zoom","drag"),e.zoom.auto(),this.sharedState.get("selectedSprite")||this.createText(),this.saveSpriteOptions(),e.render()}},{key:"_onLeave",value:function(){var e=this.context.editor;this.saveTextSettings(),e.features.enable("zoom","drag"),e.render()}}],[{key:"clickAtPosition",value:function(e,t){if(!t.operations.exists("sprite"))return!1;var n=t.operations.getOrCreate("sprite").getSpritesAtPosition(e,t.getOutputTextureDimensions()).filter(function(e){return!(e instanceof w)});return!!(n.length&&n[0]instanceof k)&&{selectedSprite:n[0]}}},{key:"getPreloadAssets",value:function(e){return["editor/controls/shared/canvas-overlay-controls/to-front.png","editor/controls/shared/canvas-overlay-controls/duplicate.png","editor/controls/shared/canvas-overlay-controls/delete.png"]}},{key:"isEnabled",value:function(e){return e.isToolAllowed("text")&&e.isToolEnabled("text")}}]),t}();S.identifier="text",S.controlsComponent=m.a,S.canvasControlsComponent=g.a,S.iconPath="editor/controls/text/icon.png",S.activeIconPath="editor/controls/text/icon-active.png",S.requiredOperations=["sprite"],S.defaultOptions={fonts:[],replaceFonts:!1,availableVariations:null},S.updatableOperations=["sprite"],S.switchToDefaultControlsOnRemoval=!0,_.a.Controls.TextControls=S,t.a=S},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(7)),_=(n.n(h),n(377)),m=n(378),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=d.GroupedControlsStyles.ControlGroupList,v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));a._bindAll("_onNewTextClick","_onFontChanged","_onFontSizeChanged","_onCharacterSpacingChanged","_onLineSpacingChanged","_onColorChanged","_onBackgroundColorChanged","_onAlignmentChanged","_onVariationChanged","_onTextScaled"),a._events=function(e,t,n){return t in e?r()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},d.Constants.EVENTS.TEXT_SCALED,a._onTextScaled),a._unavailableFontFamilies=[];var s=i[0].controls._options,l=null,c=null;return s&&s.colors&&(l=s.colors),s&&s.backgroundColors&&(c=s.backgroundColors),c=c||l,a.state={textColorPalette:l,backgroundColorPalette:c},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),g(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._loadFonts()}},{key:"_loadFonts",value:function(){var e=this,t=this.sharedState.fontManager,n=this.context.ui.getFontLoader();n.setFonts(t.getFonts());var i=void 0,r=window.setTimeout(function(){i=d.ModalManager.instance.displayLoading(e._t("pesdk.editor.text.loadingFonts"),!0)},200),o=this.sharedState.selectedSprite;return this._unavailableFontFamilies=[],n.load().then(function(){window.clearTimeout(r),i&&i.close(),o&&o.emit("update"),e.context.editor.render()}).catch(function(t){window.clearTimeout(r),i&&i.close(),t.forEach(function(t){e._unavailableFontFamilies.push(t.font.getFontFamily())});var n=e._unavailableFontFamilies.join(", ");o.emit("update"),e.context.editor.render(),e.forceUpdate(),d.ModalManager.instance.displayError(e._t("pesdk.editor.title.fontLoadingError"),e._t("pesdk.editor.text.fontLoadingError",{fonts:n}))})}},{key:"_onChangedOption",value:function(e,t){e&&this.props.controls.addLocalHistorySnapshot(e,t),this.context.editor.render(),this.forceUpdate()}},{key:"_onNewTextClick",value:function(e){this.props.controls.createText(),e.preventDefault()}},{key:"_onAlignmentChanged",value:function(e){this.sharedState.setAlignment(e),this._onChangedOption("text-alignment",!0)}},{key:"_onVariationChanged",value:function(e){this.sharedState.setVariation(e),this._onChangedOption("font-family",!0)}},{key:"_onFontChanged",value:function(e){var t=e.getVariations()[0];this._onVariationChanged(t)}},{key:"_onFontSizeChanged",value:function(e){this.sharedState.setFontSize(e),this._onChangedOption("font-size",!1)}},{key:"_onColorChanged",value:function(e){this.sharedState.setColor(e),this._onChangedOption("color",!0)}},{key:"_onBackgroundColorChanged",value:function(e){this.sharedState.setBackgroundColor(e),this._onChangedOption("background-color",!0)}},{key:"_onCharacterSpacingChanged",value:function(e){this.sharedState.setCharacterSpacing(e),this._onChangedOption()}},{key:"_onLineSpacingChanged",value:function(e){this.sharedState.setLineHeight(e),this._onChangedOption("line-spacing",!0)}},{key:"_onTextScaled",value:function(){this.forceUpdate()}},{key:"_renderFontFamilyAndSizeComponent",value:function(){var e=this,t=this.sharedState,n=t.inputDimensions,i=t.fontManager,r=this.props.controls.getCurrentFontSize(),o=d.Utils.toFixed(r*n.min(),1),a=Math.round(n.y),s=i.getFonts().filter(function(t){return e._unavailableFontFamilies.indexOf(t.getFontFamily())<0}),l=this.props.controls.getCurrentFontVariation();return d.React.createElement(_.a,{onValueChange:this._onFontSizeChanged,onFontChange:this._onFontChanged,fonts:s,dropdownValue:l.getFontFamily(),label:this._t("pesdk.text.title.font"),inputLabel:this._t("pesdk.text.title.size"),className:void 0,value:o,minValue:10,maxValue:a})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this,t=this.sharedState.fontManager,n=this.props.controls.getCurrentFontVariation(),i=t.getFontByFontFamily(n.getFontFamily()),r=this.props.controls.getCurrentLineHeight(),o=this.props.controls.getCurrentAlignment(),a=this.sharedState.color||h.Color.WHITE,s=this.sharedState.backgroundColor||h.Color.TRANSPARENT;return d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerListRef:function(t){e._list=t},innerRef:function(t){e._scrollbar=t}},d.React.createElement(b,{className:void 0},d.React.createElement(d.ButtonComponent,{title:this._t("pesdk.text.button.new"),onClick:this._onNewTextClick,className:void 0}),d.React.createElement(w,null,this._renderFontFamilyAndSizeComponent(),d.React.createElement(m.a,{alignment:o,variations:i.getVariations(),selectedVariation:n,onAlignmentChange:this._onAlignmentChanged,onVariationChange:this._onVariationChanged})),d.React.createElement(d.ColorSelectionComponent,{value:a,colorPalette:this.state.textColorPalette,onColorPickerToggle:this.fixStyles,onChange:this._onColorChanged})),d.React.createElement(k,null,d.React.createElement(d.CollapseSectionComponent,{key:"background",title:this._t("pesdk.text.title.background"),alwaysExpanded:!0,className:void 0},d.React.createElement(d.ColorSelectionComponent,{value:s,colorPalette:this.state.backgroundColorPalette,clearColorInDefaults:!0,onColorPickerToggle:this.fixStyles,onChange:this._onBackgroundColorChanged})),d.React.createElement(d.CollapseSectionComponent,{key:"spacing",title:this._t("pesdk.text.title.spacing"),alwaysExpanded:!0},d.React.createElement(d.SliderControlComponent,{label:this._t("pesdk.text.title.line"),minValue:.5,maxValue:3,className:void 0,value:d.Utils.toFixed(r,1),onSliderValueChange:this._onLineSpacingChanged,onValueChange:this._onLineSpacingChanged}))))}}]),t}();v.contextTypes=d.ControlsComponent.contextTypes,v.RootElement=d.ControlsComponent.RootElement,t.a=v;var b=d.adonis.div("1vnvjau","TopSection"),k=Object(d.adonis)(y).ul("mgrj1m","SectionList"),w=d.adonis.div("tymb4t","Details")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._updateFontsMap(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ValueSelectionComponent),h(t,[{key:"componentWillReceiveProps",value:function(e){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentWillReceiveProps",this).call(this,e),e.fonts!==this.props.fonts&&this._updateFontsMap()}},{key:"_updateFontsMap",value:function(){var e=this;this._fontsMap={},this.props.fonts.forEach(function(t){e._fontsMap[t.getFontFamily()]=t})}},{key:"_renderLeftPart",value:function(){var e=this.props.dropdownValue||this.sharedState.fontFamily,t=this._fontsMap[e];return d.React.createElement("div",{ref:"root",className:void 0},d.React.createElement(d.DropdownComponent,{value:t,style:{fontFamily:e},className:void 0,onChange:this.props.onFontChange},this.props.fonts.map(function(e){return d.React.createElement(d.DropdownComponent.Item,{value:e,key:e.getFontFamily(),style:{fontFamily:e.getFontFamily()}},e.getFontFamily())})))}}]),t}();_.contextTypes=d.ValueSelectionComponent.contextTypes,t.a=_},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"_onAlignmentItemClick",value:function(e){this.props.onAlignmentChange&&this.props.onAlignmentChange(e.title)}},{key:"_onStyleItemClick",value:function(e){switch(e.title){case"bold":this.props.onStyleChange&&this.props.onStyleChange("fontWeight",this.props.bold?"normal":"bold");break;case"italic":this.props.onStyleChange&&this.props.onStyleChange("fontStyle",this.props.italic?"normal":"italic")}}},{key:"_renderAligmentItems",value:function(){var e=this,t=this.props.alignment;return[{title:"left",selected:"left"===t,iconPath:"editor/controls/text/align-left.png",selectedIconPath:"editor/controls/text/align-left-selected.png"},{title:"center",selected:"center"===t,iconPath:"editor/controls/text/align-center.png",selectedIconPath:"editor/controls/text/align-center-selected.png"},{title:"right",selected:"right"===t,iconPath:"editor/controls/text/align-right.png",selectedIconPath:"editor/controls/text/align-right-selected.png"}].map(function(t){var n=e._getAssetPath(t.iconPath,!0),i=e._getAssetPath(t.selectedIconPath,!0);return f.React.createElement(m,{key:t.title,className:void 0,"data-alignment":t.title,"data-selected":t.selected,onClick:e._onAlignmentItemClick.bind(e,t)},f.React.createElement(g,{visible:!0,src:n}),f.React.createElement(g,{visible:t.selected,src:i}))},this)}},{key:"_renderStylesDropdown",value:function(){var e=this.props,t=e.variations,n=e.selectedVariation;return f.React.createElement(f.DropdownComponent,{value:n,onChange:this.props.onVariationChange,className:void 0,enableMenu:t.length>1},t.map(function(e){return f.React.createElement(f.DropdownComponent.Item,{value:e,key:e.getIdentifier(),style:{fontFamily:e.getFontFamily(),fontStyle:e.getFontStyle(),fontWeight:e.getFontWeight()}},e.getLabel())}))}},{key:"render",value:function(){return f.React.createElement(h,{className:void 0},f.React.createElement(_,null,this._renderStylesDropdown()),f.React.createElement(_,{right:!0},this._renderAligmentItems()))}}]),t}();d.contextTypes=f.BaseComponent.contextTypes,t.a=d;var h=f.adonis.div("1hzgwcr","TextControlsStyling"),_=f.adonis.div("64aub5",{right:"9ygmmm"},"Group"),m=f.adonis.div("tgbgl1",{selected:"zgbg08"},"ItemContainer"),g=f.adonis.img("7ni881",{visible:"zgbg08"},"ItemImage")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=(n.n(f),n(5)),d=(n.n(p),n(58)),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),_=void 0;f.Operations.SpriteOperation&&(_=f.Operations.SpriteOperation.TextSprite);var m=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.a),h(t,[{key:"_selectNextSprite",value:function(){for(var e=this.getSharedState("operation").getSprites().slice(0).reverse(),t=void 0,n=void 0,i=0;i<e.length;i++)if((t=e[i])instanceof _){n=t;break}n||(this.props.controls.skipHistory=!0,this.context.mediator.emit(p.Constants.EVENTS.SPRITES_DESELECTED)),this.setSharedState({selectedSprite:n}),this.context.screen.refreshControlsComponent()}},{key:"_createSprite",value:function(e){return this.getSharedState("operation").createText(e)}}]),t}();m.contextTypes=d.a.contextTypes,t.a=m},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=(n.n(f),n(5)),d=n.n(p),h=n(381),_=n(383),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=f.Math.Vector2,y=new g(50,50),v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,p.BaseControls),m(t,[{key:"mapOperationsToSharedState",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],{transformOperation:e.get("transform"),orientationOperation:e.get("orientation")}}},{key:"convertOperationOptionsToUI",value:function(e){var t=e.start,n=e.end,i=e.rotation,r=e.textureScale,o=this.sharedState.get("transformOperation"),a=o.calculateScale(i),s=o.getInputDimensions(!1),l=Math.cos(i),c=Math.sin(i),u=n.clone().subtract(t).divide(2),f=t.clone().add(u).multiply(s).subtract(s.clone().multiply(.5)),p=new g(f.x*l-f.y*c,f.x*c+f.y*l).multiply(a),d=s.clone().multiply(.5).add(p).clone().divide(s);return{start:d.clone().subtract(u.clone().multiply(a)),end:d.clone().add(u.clone().multiply(a)),rotation:i,textureScale:r}}},{key:"_onEnter",value:function(){var e=this.context.editor,t=this.sharedState.get("forceCrop"),n=e.operations.exists("transform"),i=e.operations.getOrCreate("transform");i.setEnabled(!1,!1);var r=e.operations.exists("orientation"),o=e.operations.getOrCreate("orientation"),a={end:new g(1,1),rotation:0,start:new g(0,0),textureScale:1},s=i.getInputDimensions(!1),l=(i.getNewDimensions(s),a),c=l,u=c.start,p=c.end,d=c.textureScale,h=c.rotation;if(n){u=(l=i.serializeOptions()).start,p=l.end,h=l.rotation,d=l.textureScale,delete l.enabled;var _=this.convertOperationOptionsToUI({start:u,end:p,textureScale:d,rotation:h});u=_.start,p=_.end}e.broadcastTransform(i,a),i.set(l,n);var m=o.serializeOptions();e.setSpriteScale(i.calculateScale(h)),e.setRotation(h),e.zoom.auto(!0,!1,function(){e.features.disable("zoom","drag",t?"export":void 0)},!1),this.sharedState.set({transformOperation:i,initialTransformOptions:l,newTransformOptions:{start:u,end:p,rotation:h,textureScale:d},transformOperationExistedBeforeEntering:n,orientationOperation:o,initialOrientationOptions:m,newOrientationOptions:f.Utils.cloneOptions(m),orientationOperationExistedBeforeEntering:r,start:g.fromObject(u),end:g.fromObject(p),rotation:h,orientationRotation:o.getRotation(),flipVertically:o.getFlipVertically(),flipHorizontally:o.getFlipHorizontally(),ratio:i._ratio||this.sharedState.get("ratio")||null})}},{key:"_onLeave",value:function(){var e=this.context.editor,t=this.sharedState.get("orientationOperation"),n=this.sharedState.get("forceCrop");t.optionsEqual({rotation:0,flipVertically:!1,flipHorizontally:!1})&&e.operations.remove(t,!1),this.applyNewTransformOptions();var i=this.sharedState.get("transformOperation");if(i){var r={start:i.getStart(),end:i.getEnd(),textureScale:i.getTextureScale(),rotation:i.getRotation()},o={start:new g(0,0),end:new g(1,1),rotation:0,textureScale:1};e.broadcastTemporaryTransform(i,r),i.set(o),e.broadcastTransform(i,r),i.set(r),i.getStart().equals(o.start)&&i.getEnd().equals(o.end)&&i.getRotation()===o.rotation&&i.getTextureScale()===o.textureScale?e.operations.remove(i,!1):i.setEnabled(!0),e.setRotation(0),e.setSpriteScale(1),e.features.enable("zoom","drag",n?"export":void 0),e.zoom.auto(!0)}}},{key:"_getGlobalHistoryData",value:function(){return{ratio:this.sharedState.get("ratio")}}},{key:"_onOperationRemoved",value:function(e){}},{key:"applyNewTransformOptions",value:function(){var e=this.context.editor,t=this.sharedState.get("transformOperation");if(t){var n=this.sharedState.get("newTransformOptions"),i=n.start,r=n.end,o=n.textureScale,a=n.rotation;o=this._calculateTextureScale(),i=i.clone(),r=r.clone();var s=t.calculateScale(a),l=t.getInputDimensions(!1),c=Math.cos(-a),u=Math.sin(-a),f=r.clone().subtract(i).divide(2),p=i.clone().add(f).multiply(l).subtract(l.clone().multiply(.5)),d=new g(p.x*c-p.y*u,p.x*u+p.y*c).divide(s),h=l.clone().multiply(.5).add(d).clone().divide(l),_=h.clone().subtract(f.clone().divide(s)),m=h.clone().add(f.clone().divide(s)),y={start:new g(0,0),end:new g(1,1),rotation:0,textureScale:1},v={start:_,end:m,textureScale:o,rotation:a};t.set(y),e.broadcastTemporaryTransform(t,v),t.set(v),t._ratio=this.sharedState.get("ratio"),t.setTextureScale(this._calculateTextureScale())}}},{key:"_calculateTextureScale",value:function(){var e=this.sharedState.get("transformOperation");if(!e)return 1;var t=this.sharedState.get("ratio");if(!t||!t.getDimensions()||!t.getLockDimensions())return 1;var n=t.getDimensions(),i=this.sharedState.get("start"),r=this.sharedState.get("end").clone().subtract(i),o=e.getInputDimensions(!1).multiply(r);return n.x/o.x}},{key:"fixTransform",value:function(e,t,n,i){var r=this.context.editor,o=this.sharedState.get("transformOperation");if(!o)return{start:new g(0,0),end:new g(1,1)};var a=o.getInputDimensions(!1),s=this.sharedState.get("ratio"),l=s&&s.getRatio(),c=s&&s.getDimensions();(s.getForceDimensions()||s.getLockDimensions())&&(l=c.x/c.y);var u=new g;u.x="left"===n?t.x:1-e.x,u.y="top"===i?t.y:1-e.y;var f=a.clone().multiply(u),p=t.clone().subtract(e).clone().multiply(a),d=y.clone().divide(r.zoom.targetLevel),h=new g(Math.min(d.x,.1*a.x),Math.min(d.y,.1*a.y));p.x=Math.min(Math.max(h.x,p.x),f.x),"*"!==l&&(p.y=p.x/l),p.y=Math.min(Math.max(h.y,p.y),f.y),"*"!==l&&(p.x=p.y*l);var _=p.divide(a);return"top"===i?e.y=t.y-_.y:t.y=e.y+_.y,"left"===n?e.x=t.x-_.x:t.x=e.x+_.x,"*"===l&&(e.multiply(a).round().divide(a),t.multiply(a).round().divide(a)),{start:e,end:t}}}],[{key:"getPreloadAssets",value:function(e){var t=e.getOptions(),n=f.Utils.defaults(t.editor.controlsOptions.transform,this.defaultOptions),i=["editor/controls/transform/dimensions-cross.png","editor/controls/transform/degree-slider.png","editor/controls/transform/flip.png","editor/controls/transform/lock.png","editor/controls/transform/rotate.png"];return new p.TransformRatioManager(n).getCategories().forEach(function(e){e.getRatios().forEach(function(e){var t=e.getIdentifier();i.push("editor/controls/transform/ratios/"+t+"-default.png","editor/controls/transform/ratios/"+t+"-hover.png","editor/controls/transform/ratios/"+t+"-active.png")})}),i}},{key:"isEnabled",value:function(e){return e.isToolAllowed("transform")&&e.isToolEnabled("transform")}}]),t}();v.clickAtPosition=p.BaseControls.clickAtPosition,v.identifier="transform",v.controlsComponent=_.a,v.canvasControlsComponent=h.a,v.iconPath="editor/controls/transform/icon.png",v.activeIconPath="editor/controls/transform/icon-active.png",v.requiredOperations=["transform","orientation"],v.defaultOptions={categories:[],replaceCategories:!1,availableRatios:null,enableRotation:!0,enableStraighten:!0,enableFlip:!0,enableAcceptButton:!1},v.updatableOperations=["transform","orientation"],v.switchToDefaultControlsOnRemoval=!1,d.a.Controls.TransformControls=v,t.a=v},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(6),s=n.n(a),l=n(2),c=n.n(l),u=n(3),f=n.n(u),p=n(1),d=n.n(p),h=n(7),_=(n.n(h),n(5)),m=(n.n(_),n(15)),g=n(382),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function e(t,n,i){null===t&&(t=Function.prototype);var r=s()(t,n);if(void 0===r){var o=d()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},b=h.Math.Vector2,k=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||d()(t)).call.apply(e,[this].concat(o)));return s._bindAll("_onZoomDone","_onCornerDrag","_onCornerDragEnd","_onCenterDragStart","_onCenterDrag","_onCenterDragEnd","_onRotationChange","_onOperationUpdated","_onOperationRemoved","_onAcceptClick","_onAcceptMouseDown"),s._events=(i(n={},_.Constants.EVENTS.OPERATION_UPDATED,s._onOperationUpdated),i(n,_.Constants.EVENTS.OPERATION_REMOVED,s._onOperationRemoved),i(n,_.Constants.EVENTS.ZOOM_DONE,s._onZoomDone),n),s.state=h.Utils.extend(s.state,{visible:!1}),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=f()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(c.a?c()(e,t):e.__proto__=t)}(t,_.CanvasControlsComponent),y(t,[{key:"shouldSharedComponentUpdate",value:function(e,t){return!e.start.equals(t.start)||!e.end.equals(t.end)||e.orientationRotation!==t.orientationRotation||e.ratio!==t.ratio||e.changesDone!==t.changesDone}},{key:"sharedStateDidChange",value:function(e,t){(e.ratio&&e.ratio.getRatio())!==(t.ratio&&t.ratio.getRatio())&&this._calculateRatioFraction()}},{key:"sharedComponentWillUpdate",value:function(e,t){e.orientationRotation!==t.orientationRotation&&this._updateTransformAreaStyles()}},{key:"componentDidMount",value:function(){v(t.prototype.__proto__||d()(t.prototype),"componentDidMount",this).call(this),this._updateTransformAreaStyles(),this._calculateRatioFraction(),this.forceUpdate()}},{key:"componentWillUpdate",value:function(){this._updateTransformAreaStyles()}},{key:"componentDidUpdate",value:function(){!this._transformContainerRect&&this.getSharedState("ratio")&&(this._updateTransformAreaStyles(),this.forceUpdate())}},{key:"componentWillUnmount",value:function(){v(t.prototype.__proto__||d()(t.prototype),"componentWillUnmount",this).call(this),this._zoomAFRequest&&(Object(m.a)(this._zoomAFRequest),this._zoomAFRequest=null)}},{key:"_calculateRatioFraction",value:function(){var e=this.getSharedState("ratio");e&&"*"!==e.getRatio()&&(this._ratioFraction=_.Utils.findIntegerFraction(e.getRatio()))}},{key:"_onCenterDragStart",value:function(e){var t=this.getSharedState("transformOperation");this._dragOptions={initialStart:this.getSharedState("start").clone(),initialEnd:this.getSharedState("end").clone(),areaDimensions:this._transformContainerRect.getSize(),imageDimensions:t.getInputDimensions(!1)}}},{key:"_onCenterDrag",value:function(e){var t=this._dragOptions,n=t.initialStart,i=t.initialEnd,r=t.areaDimensions,o=t.imageDimensions,a=e.clone().divide(r),s=i.clone().subtract(n),l=new b(0,0),c=new b(1,1).subtract(s),u=n.clone().add(a).clamp(l,c),f=u.clone().add(s);u.multiply(o).floor().divide(o),f.multiply(o).floor().divide(o),this.props.controls.fixTransform(u,f,"right","bottom");var p=this.getSharedState("newTransformOptions");p.start=u,p.end=f,this.setSharedState({start:u,end:f,changesDone:this.getSharedState("changesDone")||!(n.equals(u)&&i.equals(f))})}},{key:"_onCenterDragEnd",value:function(){this._emitEvent(_.Constants.EVENTS.TRANSFORM_AFTER_EDIT)}},{key:"_onCornerDragStart",value:function(e,t,n){var i=this.getSharedState("transformOperation");this._dragOptions={initialStart:this.getSharedState("start").clone(),initialEnd:this.getSharedState("end").clone(),verticalSide:e,horizontalSide:t,areaDimensions:this._transformContainerRect.getSize(),imageDimensions:i.getInputDimensions(!1)},this._currentCorner={vertical:e,horizontal:t}}},{key:"_onCornerDrag",value:function(e){var t=this._dragOptions,n=t.initialStart,i=t.initialEnd,r=t.verticalSide,o=t.horizontalSide,a=t.areaDimensions,s=e.clone().divide(a),l=n.clone(),c=i.clone();("top"===r?l:c).y+=s.y,("left"===o?l:c).x+=s.x,this.props.controls.fixTransform(l,c,o,r);var u=this.getSharedState("newTransformOptions");u.start=l,u.end=c,this.setSharedState({start:l,end:c,changesDone:!0}),this._emitEvent(_.Constants.EVENTS.TRANSFORM_RESIZE)}},{key:"_onCornerDragEnd",value:function(){this._emitEvent(_.Constants.EVENTS.TRANSFORM_AFTER_EDIT)}},{key:"_onRotationChange",value:function(e){var t=this.getSharedState("transformOperation"),n=this.context.editor;n.setRotation(e),n.setSpriteScale(t.calculateScale(e)),this.getSharedState("newTransformOptions").rotation=e,n.render(),this.setSharedState({rotation:e,changesDone:!0})}},{key:"_onZoomDone",value:function(){var e=this;this._zoomAFRequest=Object(m.b)(function(){e._updateTransformAreaStyles(),e.state.visible=!0,e.forceUpdate(),e._zoomAFRequest=null})}},{key:"_onOperationUpdated",value:function(e){if(e===this.getSharedState("transformOperation")){var t=this.context.editor,n=t.getSDK();n.setRotation(e.getRotation()),n.setSpriteScale(e.calculateScale()),t.render(),this.setSharedState({rotation:e.getRotation()}),this.forceUpdate()}}},{key:"_onOperationRemoved",value:function(e){"transform"!==e.constructor.identifier&&"orientation"!==e.constructor.identifier||this.forceUpdate()}},{key:"_onFlipClick",value:function(e,t){var n=this.context.editor,r=this.getSharedState("orientationOperation"),o=this.getSharedState("newTransformOptions"),a=r.getRotation();90!==a&&270!==a||(e="horizontal"===e?"vertical":"horizontal");var s=this.getSharedState("start").clone(),l=this.getSharedState("end").clone(),c=s.clone();"horizontal"===e?(s.set(1-l.x,s.y),l.set(1-c.x,l.y)):"vertical"===e&&(s.set(s.x,1-l.y),l.set(l.x,1-c.y));var u=e.charAt(0).toUpperCase()+e.slice(1)+"ly",f=!this.getSharedState("flip"+u);this.setSharedState(i({},"flip"+u,f)),r.flip(e);var p=this.getSharedState("rotation");o.start=s,o.end=l,o.rotation=p,this.setSharedState({start:s,end:l,rotation:p,changesDone:!0,newTransformOptions:o}),this._emitEvent(_.Constants.EVENTS.TRANSFORM_AFTER_EDIT),this.forceUpdate(),n.broadcastFlip(e),n.render(),t.preventDefault()}},{key:"_onAcceptClick",value:function(e){e.preventDefault(),e.stopPropagation(),this._emitEvent(_.Constants.EVENTS.TRANSFORM_AFTER_EDIT),this.context.screen.switchToControls("default")}},{key:"_onAcceptMouseDown",value:function(e){e.stopPropagation()}},{key:"_onRotateClick",value:function(e,t){var n=this,i=this.getSharedState("orientationOperation"),r=i.getFlipVertically()!==i.getFlipHorizontally(),o="cw"===e?90:-90;o*=r?-1:1;var a=this.context.editor,s=(i.getRotation()+o)%360;i.set({rotation:s});var l={orientationRotation:s},c=this.getSharedState("newTransformOptions"),u=this.getSharedState("ratio");if(u)if(u.getForceDimensions()||u.getLockDimensions()||"*"!==u.getRatio())this._emitEvent(_.Constants.EVENTS.TRANSFORM_REAPPLY_RATIO),this._emitEvent(_.Constants.EVENTS.TRANSFORM_RESIZE);else{var f=this.getSharedState("start").clone(),p=this.getSharedState("end").clone(),d=f.clone();"cw"===e?(f.set(1-p.y,d.x),p.set(1-d.y,p.x)):"ccw"===e&&(f.set(d.y,1-p.x),p.set(p.y,1-d.x)),l.start=f,l.end=p,c.start=f,c.end=p}this.setSharedState({changesDone:!0,newTransformOptions:c}),a.broadcastRotate(o),a.zoom.auto(!0,!0,function(){n.setSharedState(l),n._emitEvent(_.Constants.EVENTS.TRANSFORM_AFTER_EDIT)}),t.preventDefault()}},{key:"_updateTransformAreaStyles",value:function(){this._transformContainerRect=this.getImageBoundingRect(),this._imageContainer&&_.Utils.styleElement(this._imageContainer,{left:this._transformContainerRect.x+"px",top:this._transformContainerRect.y+"px",width:this._transformContainerRect.width+"px",height:this._transformContainerRect.height+"px"})}},{key:"_getAreaStyles",value:function(){var e=void 0,t=void 0,n=void 0,i=void 0;this._transformContainer?(e=this._transformContainerRect.getSize(),i=this._transformContainerRect.getPosition(),t=this.getSharedState("start").clone().multiply(e),n=this.getSharedState("end").clone().multiply(e).clone().subtract(t)):(e=new b(0,0),t=new b(0,0),n=new b(0,0),i=new b(0,0));var r=this._getDimensionsStyles(n.x,n.y);return{topLeft:this._getDimensionsStyles(t.x+i.x,t.y+i.y),topCenter:this._getDimensionsStyles(n.x,t.y+i.y),centerLeft:this._getDimensionsStyles(t.x+i.x,n.y),center:{width:r.width},innerTransformContainer:r}}},{key:"_getDimensionsStyles",value:function(e,t){return{width:Math.max(1,e),height:Math.max(1,t)}}},{key:"_renderOnCanvasControls",value:function(){var e=this,t=this._getAreaStyles(),n=!this.getSharedState("ratio"),i=this.getSharedState("forceCrop"),r=this.props.options.enableAcceptButton,o={backgroundImage:"url('"+this._getAssetPath("editor/controls/transform/accept.png",!0)+"')"};return _.React.createElement(S,{innerRef:function(t){e._container=t}},_.React.createElement(T,{className:"js-imageContainer",innerRef:function(t){e._imageContainer=t}},(r||i)&&_.React.createElement(L,{className:void 0,enabled:this.getSharedState("changesDone"),onClick:this._onAcceptClick,onMouseDown:this._onAcceptMouseDown,style:o})),_.React.createElement(O,{className:void 0,visible:this.state.visible,innerRef:function(t){e._transformContainer=t}},_.React.createElement(D,null,_.React.createElement(M,{style:t.topLeft}),_.React.createElement(M,{style:t.topCenter}),_.React.createElement(M,null)),_.React.createElement(D,null,_.React.createElement(M,{style:t.centerLeft}),_.React.createElement(_.DraggableComponent,{onStart:this._onCenterDragStart,onDrag:this._onCenterDrag,onStop:this._onCenterDragEnd,disabled:n},_.React.createElement(A,{style:t.center,className:void 0,undraggable:n},!n&&[_.React.createElement(_.DraggableComponent,{onStart:this._onCornerDragStart.bind(this,"top","left"),onDrag:this._onCornerDrag,onStop:this._onCornerDragEnd,key:"topLeft"},_.React.createElement(F,{top:!0,left:!0,className:void 0})),_.React.createElement(_.DraggableComponent,{onStart:this._onCornerDragStart.bind(this,"top","right"),onDrag:this._onCornerDrag,onStop:this._onCornerDragEnd,key:"topRight"},_.React.createElement(F,{top:!0,right:!0,className:void 0})),_.React.createElement(_.DraggableComponent,{onStart:this._onCornerDragStart.bind(this,"bottom","left"),onDrag:this._onCornerDrag,onStop:this._onCornerDragEnd,key:"bottomLeft"},_.React.createElement(F,{bottom:!0,left:!0,className:void 0})),_.React.createElement(_.DraggableComponent,{onStart:this._onCornerDragStart.bind(this,"bottom","right"),onDrag:this._onCornerDrag,onStop:this._onCornerDragEnd,key:"bottomRight"},_.React.createElement(F,{bottom:!0,right:!0,className:void 0})),_.React.createElement(R,{style:t.innerTransformContainer,className:void 0,key:"inner"},_.React.createElement(D,null,_.React.createElement(P,{right:!0,bottom:!0}),_.React.createElement(P,{right:!0,bottom:!0}),_.React.createElement(P,{bottom:!0})),_.React.createElement(D,null,_.React.createElement(P,{right:!0,bottom:!0}),_.React.createElement(P,{right:!0,bottom:!0}),_.React.createElement(P,{bottom:!0})),_.React.createElement(D,null,_.React.createElement(P,{right:!0}),_.React.createElement(P,{right:!0}),_.React.createElement(P,null)))])),_.React.createElement(M,null)),_.React.createElement(D,null,_.React.createElement(M,null),_.React.createElement(M,null),_.React.createElement(M,null))))}},{key:"_renderControls",value:function(){var e={backgroundImage:"url('"+this._getAssetPath("editor/controls/transform/flip.png",!0)+"')"},t={backgroundImage:"url('"+this._getAssetPath("editor/controls/transform/rotate.png",!0)+"')"},n=this.props.options,i=n.enableRotation,r=n.enableFlip,o=n.enableStraighten;return _.React.createElement(w,{className:void 0},this._renderOnCanvasControls(),_.React.createElement(C,null,_.React.createElement(E,{className:void 0},r&&[_.React.createElement(B,{style:e,key:"flip-h",onClick:this._onFlipClick.bind(this,"horizontal"),className:void 0}),_.React.createElement(B,{vertical:!0,style:e,key:"flip-v",onClick:this._onFlipClick.bind(this,"vertical"),className:void 0})],o&&_.React.createElement(g.a,{value:this.getSharedState("rotation"),onChange:this._onRotationChange}),i&&[_.React.createElement(N,{style:t,key:"rotate-ccw",onClick:this._onRotateClick.bind(this,"ccw"),className:void 0}),_.React.createElement(N,{clockwise:!0,style:t,key:"rotate-cw",onClick:this._onRotateClick.bind(this,"cw"),className:void 0})])))}}]),t}();k.contextTypes=_.CanvasControlsComponent.contextTypes,t.a=k;var w=_.adonis.div("120drhm","CanvasControls"),S=_.adonis.div("8gacw5",{draggable:"ovipzq"},"OnCanvasControls"),C=_.adonis.div("nmw377","BottomControlsContainer"),E=_.adonis.div("1gk061a","BottomControls"),x=_.adonis.div("1v9hd4r","TransformContainer"),T=_.adonis.div("15kzu1c","ImageContainer"),O=Object(_.adonis)(x)("1kjfwvf",{visible:"zgbg08"},"OuterTransformContainer"),R=Object(_.adonis)(x)("120drhm","InnerTransformContainer"),D=_.adonis.div("15u7gri","TransformRow"),I=_.adonis.div("1q481v0","TransformCell"),P=Object(_.adonis)(I)("1qh9j3j",{top:"1mup05p",right:"12l7t8k",bottom:"1ebuiz6",left:"txqhsl"},"BorderedTransformCell"),A=Object(_.adonis)(I)("52h18o",{undraggable:"16s6vgr"},"CenterTransformCell"),M=Object(_.adonis)(I)("17b4s67","DarkTransformCell"),F=_.adonis.div("1tai30v",{top:"1stnln8",right:"1wj5vxi",bottom:"17bojqc",left:"1a9ompl"},"Dragger"),j=_.adonis.button("127b6wl","Button"),B=Object(_.adonis)(j)("120drhm",{vertical:"12fqiy2"},"FlipButton"),N=Object(_.adonis)(j)("120drhm",{clockwise:"o7ss47"},"RotateButton"),L=_.adonis.div("sbdqjz",{enabled:"ro0g1e"},"AcceptButton")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),_=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onDragStart","_onDrag","_onDragEnd"),o._width=0,o.state={value:o.props.value||0},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.BaseComponent),h(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._degreesPerPixel=90/217}},{key:"componentWillReceiveProps",value:function(e){this.state.value!==e.value&&this.setState({value:e.value})}},{key:"_onDragStart",value:function(){this._initialDegrees=180*this.state.value/Math.PI}},{key:"_onDrag",value:function(e){var t=this._initialDegrees+e.x*this._degreesPerPixel,n=(t=Math.min(45,Math.max(t,-45)))*Math.PI/180;this.setState({value:n}),this.props.onChange&&this.props.onChange(n)}},{key:"_onDragEnd",value:function(e){this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT)}},{key:"_getValue",value:function(){return Math.round(180*this.state.value/Math.PI)+"°"}},{key:"_getIndicatorPosition",value:function(){var e=45*Math.PI/180;return this._width/2+this.state.value/e*(this._width/2)}},{key:"_getIndicatorStyles",value:function(){var e=45*Math.PI/180;return{left:{left:108.5+this.state.value/e*108.5},right:{right:108.5-this.state.value/e*108.5}}}},{key:"render",value:function(){var e=this._getIndicatorStyles(),t={backgroundImage:"url('"+this._getAssetPath("editor/controls/transform/degree-slider.png",!0)+"')",backgroundPosition:e.left.left-4},n={backgroundImage:"url('"+this._getAssetPath("editor/controls/transform/degree-slider.png",!0)+"')",backgroundPosition:e.left.left+35};return d.React.createElement(d.DraggableComponent,{onStart:this._onDragStart,onDrag:this._onDrag,onStop:this._onDragEnd},d.React.createElement(m,{className:void 0},d.React.createElement(g,{style:t},d.React.createElement(y,{style:e.left})),d.React.createElement(v,{className:void 0},this._getValue()),d.React.createElement(g,{style:n},d.React.createElement(y,{style:e.right}))))}}]),t}();_.contextTypes=d.BaseComponent.contextTypes,t.a=_;var m=d.adonis.div("tix0xu","Wrapper"),g=d.adonis.div("6mdana","RotationSlider"),y=d.adonis.div("nxjpo","Indicator"),v=d.adonis.div("d97kws","Value")},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(2),s=n.n(a),l=n(3),c=n.n(l),u=n(1),f=n.n(u),p=n(7),d=(n.n(p),n(5)),h=(n.n(d),n(384)),_=n(385),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=d.GroupedControlsStyles.ControlGroupList,y=d.GroupedControlsStyles.ControlGroup,v=d.GroupedControlsStyles.ControlGroupTitle,b=p.Math.Vector2,k=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(o)));return s._bindAll("_reapplyRatio","_onHistoryChange","_onResetDefaultClick","_onOperationRemoved","_onOperationUpdated","_onTransformAfterEdit"),s._events=(i(n={},d.Constants.EVENTS.TRANSFORM_REAPPLY_RATIO,s._reapplyRatio),i(n,d.Constants.EVENTS.OPERATION_REMOVED,s._onOperationRemoved),i(n,d.Constants.EVENTS.OPERATION_UPDATED,s._onOperationUpdated),i(n,d.Constants.EVENTS.HISTORY_UNDO,s._onHistoryChange),i(n,d.Constants.EVENTS.HISTORY_REDO,s._onHistoryChange),i(n,d.Constants.EVENTS.TRANSFORM_AFTER_EDIT,s._onTransformAfterEdit),n),s._transformRatioManager=new d.TransformRatioManager(s.props.options),s.state.ratio=null,s._selectInitialRatio(!1,!0),s._onTransformAfterEdit(!0),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=c()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.a?s()(e,t):e.__proto__=t)}(t,d.ControlsComponent),m(t,[{key:"shouldSharedComponentUpdate",value:function(e,t){return e.ratio!==t.ratio}},{key:"_onHistoryChange",value:function(e){var t=this.context.editor,n={},i=t.operations.get("transform");if(i){var r=this.getSharedState("newTransformOptions"),o=this.props.controls.convertOperationOptionsToUI(i.serializeOptions());r.start=o.start,r.end=o.end,r.rotation=o.rotation,r.textureScale=o.textureScale,n.newTransformOptions=r,n.changesDone=!0,e.data&&e.data.ratio&&(n.ratio=e.data.ratio),e.identifier&&e.identifier.ratio&&(n.ratio=e.identifier.ratio,n.ratio.setLockDimensions(e.identifier.lockDimensions));var a={end:new b(1,1),rotation:0,start:new b(0,0),textureScale:1};t.broadcastTransform(i,a),this.setSharedState(n),t.zoom.auto(!0,!0),this.forceUpdate()}}},{key:"_onOperationUpdated",value:function(e){var t=this.context.editor;if(this.getSharedState("transformOperation")===e){var n=this.props.controls.convertOperationOptionsToUI(e.serializeOptions());this.setSharedState({rotation:n.rotation,start:n.start,end:n.end}),t.zoom.auto(!0,!0)}}},{key:"_onOperationRemoved",value:function(e){var t=this.context.editor;if(this.getSharedState("transformOperation")===e){var n=t.operations.getOrCreate("transform",{enabled:!1}),i=t.getSDK();i.setRotation(0),i.setSpriteScale(1),this.setSharedState({transformOperation:n,rotation:0}),n._ratio=null,this._selectInitialRatio(!0,!1)}if(this.getSharedState("orientationOperation")===e){var r=t.operations.getOrCreate("orientation");this.setSharedState({orientationOperation:r,rotation:0,flipVertically:!1,flipHorizontally:!1})}}},{key:"_onResetDefaultClick",value:function(e){var t=this.context.editor,n=this.getSharedState("orientationOperation"),i=this.getSharedState("transformOperation");n.set({flipHorizontally:!1,flipVertically:!1,rotation:0});var r=this.getSharedState("newTransformOptions");r.start=new b(0,0),r.end=new b(1,1),r.rotation=0,i._ratio=null,this._selectInitialRatio(!0,!0),this.setSharedState({ratio:i._ratio,orientationRotation:0,rotation:0,flipVertically:!1,flipHorizontally:!1,changesDone:!0}),this._emitEvent(d.Constants.EVENTS.TRANSFORM_RESIZE),this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT),t.setRotation(0),t.setSpriteScale(1),t.zoom.auto(!0,!0),e.preventDefault()}},{key:"_onTransformAfterEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.props.controls.applyNewTransformOptions(),!e){var t=this.getSharedState("ratio"),n=this.getSharedState("transformOperation"),i=t?t.getDimensions():null,r=t.getLockDimensions(),o=null;if(t&&(t.getForceDimensions()||r))o=i.clone();else{var a=n.getInputDimensions(!1),s=this.getSharedState("start");o=this.getSharedState("end").clone().subtract(s).multiply(a).round()}t.setDimensions(o);var l={ratio:t,dimensions:o,lockDimensions:r};this.props.controls.addLocalHistorySnapshot(l,!1)}}},{key:"_reapplyRatio",value:function(){var e=this.getSharedState("ratio");this._selectRatio(e)}},{key:"_selectRatio",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this.getSharedState("transformOperation");t&&e&&this._setDefaultOptionsForRatio(e,n),i._ratio=e,this.setSharedState({ratio:e},n),n&&this.setSharedState({changesDone:!0}),this._emitEvent(d.Constants.EVENTS.TRANSFORM_RESIZE),n&&this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT)}},{key:"_setDefaultOptionsForRatio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e&&e.getRatio(),i=e&&e.getDimensions(),r=new b,o=new b;if(i&&!n&&(n=i.x/i.y),n&&"*"!==n){var a=this.getSharedState("transformOperation").getInputDimensions(!1),s=void 0,l=void 0;a.x/a.y<=n?(s=(l=a.x/n)*n,r.set((a.x-s)/2,(a.y-l)/2)):(l=(s=a.y*n)/n,r.set((a.x-s)/2,(a.y-l)/2)),o.copy(r).add(s,l),r.divide(a),o.divide(a)}else r=new b(0,0),o=new b(1,1);var c=this.getSharedState("newTransformOptions");c.start=r,c.end=o,this.setSharedState({start:r,end:o},t)}},{key:"_selectInitialRatio",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getSharedState("transformOperation"),r=null,o=this._transformRatioManager.getCategories().map(function(t){return e._transformRatioManager.getRatiosForCategory(t)}).reduce(function(e,t){return e.concat(t)}),a=i._ratio;if(a&&(r=a),r||(r=o.filter(function(e){return e.getSelected()}).pop()),!r){var s=i.getInputDimensions(!1),l=i.getEnd().clone().subtract(i.getStart().clone()),c=l.x*s.x/(l.y*s.y),u=function(e){return Math.floor(1e6*e)/1e6};r=o.filter(function(e){return u(c)===u(e.getRatio())}).pop()}return r?this._selectRatio(r,t,n):("*"!==(r=o[0]).getRatio()&&this.setSharedState({changesDone:!0}),this._selectRatio(r,!0,n))}},{key:"_renderSections",value:function(){var e=this,t=function(t){var n=e.getSharedState("ratio").getIdentifier();return e._transformRatioManager.getRatiosForCategory(t).map(function(i){var r=i.getIdentifier(),o=n===r;return d.React.createElement(h.a,{key:r,defaultIconPath:"editor/controls/transform/ratios/"+r+"-default.png",hoverIconPath:"editor/controls/transform/ratios/"+r+"-hover.png",activeIconPath:"editor/controls/transform/ratios/"+r+"-active.png",onClick:e._selectRatio.bind(e,i),title:e._t("pesdk.transform.asset."+t.getIdentifier()+".asset."+r)||i.getDefaultName(),identifier:r,selected:o})})};return this._transformRatioManager.getCategories().map(function(n){return e._transformRatioManager.getRatiosForCategory(n).length>0?function(n){return d.React.createElement(C,{key:n.getIdentifier()},d.React.createElement(E,null,e._t("pesdk.transform.asset."+n.getIdentifier()+".name")||n.getDefaultName()),d.React.createElement(x,null,t(n)))}(n):null})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this,t=this.context.options.editor.forceCrop,n=this.getSharedState("ratio");return[d.React.createElement(d.ScrollableListComponent,{key:"list",direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement(S,null,d.React.createElement(w,null,d.React.createElement(d.ButtonComponent,{disabled:t,title:this._t("pesdk.transform.button.reset"),className:void 0,onClick:this._onResetDefaultClick})),this._renderSections())),d.React.createElement(_.a,{key:"transformDimensions",controls:this.props.controls,disabled:!n||!!n.getForceDimensions()})]}}]),t}();k.contextTypes=d.ControlsComponent.contextTypes,k.RootElement=d.ControlsComponent.RootElement,t.a=k;var w=d.adonis.li("7abnmv","SectionListHeader"),S=Object(d.adonis)(g).ul("x32ss4","SectionList"),C=Object(d.adonis)(y).li("ber9o0","Section"),E=Object(d.adonis)(v).div("15ebqhq","SectionTitle"),x=d.adonis.ul("1klgjyq","SectionGrid")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(5),p=(n.n(f),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),d=f.ControlsStyles.PlainControlItem,h=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||u()(t)).call.apply(e,[this].concat(i)));return o.state={hovered:!1},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,f.BaseComponent),p(t,[{key:"render",value:function(){var e=this,t={backgroundImage:"url('"+this._getAssetPath(this.props.defaultIconPath,!0)+"')"},n={backgroundImage:"url('"+this._getAssetPath(this.props.hoverIconPath,!0)+"')"},i={backgroundImage:"url('"+this._getAssetPath(this.props.activeIconPath,!0)+"')"},r=this.props,o=r.selected,a=r.onClick,s=r.identifier,l=r.title,c=this.state.hovered;return f.React.createElement(_,{selected:o,onClick:a,"data-identifier":s,"data-selected":o,onMouseEnter:function(){return e.setState({hovered:!0})},onMouseLeave:function(){return e.setState({hovered:!1})},className:void 0},f.React.createElement(f.Transition,{active:!o},f.React.createElement(m,{style:t})),f.React.createElement(f.Transition,{active:!o&&c},f.React.createElement(m,{style:n})),f.React.createElement(f.Transition,{active:o},f.React.createElement(m,{style:i})),f.React.createElement(g,{selected:o},l))}}]),t}();h.contextTypes=f.BaseComponent.contextTypes,t.a=h;var _=Object(f.adonis)(d).li("71xi0n","TransformListItem"),m=f.adonis.div("u0ryhr",{rendered:"2jlos",visible:"82svov"},"Icon"),g=f.adonis.div("jpjwq7",{selected:"zgbg08"},"Title")},function(e,t,n){"use strict";function i(e,t,n){return t in e?o()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=n(0),o=n.n(r),a=n(2),s=n.n(a),l=n(3),c=n.n(l),u=n(1),f=n.n(u),p=n(7),d=(n.n(p),n(5)),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),o()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}()),_=d.GroupedControlsStyles.ControlGroupTitle,m=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||f()(t)).call.apply(e,[this].concat(o)));s._bindAll("_onHistoryChange"),s._events=(i(n={},d.Constants.EVENTS.HISTORY_UNDO,s._onHistoryChange),i(n,d.Constants.EVENTS.HISTORY_REDO,s._onHistoryChange),n);var l=s._getTransformDimensions();return s.state={nextDimensions:l},s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=c()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(s.a?s()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),h(t,[{key:"shouldSharedComponentUpdate",value:function(e,t){return!e.start.equals(t.start)||!e.end.equals(t.end)||e.ratio&&e.ratio.equals(t.ratio)}},{key:"sharedComponentWillUpdate",value:function(e,t){t.transformOperation&&(this.state.nextDimensions=this._getTransformDimensions(),this.forceUpdate())}},{key:"_onHistoryChange",value:function(e){if(e.identifier){var t=e.identifier.dimensions;t&&(this.state.nextDimensions=t)}}},{key:"_onInputLiveChange",value:function(e,t){var n=t.target.value;n.length&&!n.match(/\d+?/i)||(this.state.nextDimensions[e]=n&&parseInt(n,10)||"",this.forceUpdate())}},{key:"_onInputChange",value:function(e,t){var n=Math.max(this.state.nextDimensions[e]||1,1),i=this.getSharedState("transformOperation").getInputDimensions(!1),r=this.getSharedState("ratio"),o=r.getRatio(),a=r.getLockDimensions(),s=r.getDimensions(),l=this.getSharedState("start"),c=this.getSharedState("end").clone().subtract(l),u=c.clone().multiply(i);u[e]=Math.min(i[e],n);var f=o;null!==f&&"*"!==f||(f=s?s.x/s.y:c.x/c.y),("*"!==o||a)&&("x"===e?u.y=u.x/f:u.x=u.y*f);var h=u.clone();(u.x>i.x||u.y>i.y)&&(h=p.Utils.resizeVectorToFit(u,i)),h.round();var _=this._getTransformDimensions();this.state.nextDimensions=_,a?r.setDimensions(h):(this._resizeTransformTo(h),r.setDimensions(this.state.nextDimensions)),this._emitEvent(d.Constants.EVENTS.TRANSFORM_RESIZE),this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT),this.forceUpdate()}},{key:"_onLockDimensionsChange",value:function(){var e=this.getSharedState("ratio"),t=!e.getLockDimensions();e.setLockDimensions(t),t||(this.state.nextDimensions=this._getTransformDimensions()),e.setDimensions(this.state.nextDimensions),this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT),this.forceUpdate()}},{key:"_getTransformDimensions",value:function(){var e=this.getSharedState("transformOperation"),t=this.getSharedState("ratio"),n=t?t.getDimensions():null,i=null;if(t&&(t.getForceDimensions()||t.getLockDimensions()))i=n.clone();else{var r=e.getInputDimensions(!1),o=this.getSharedState("start");i=this.getSharedState("end").clone().subtract(o).multiply(r).round()}return i}},{key:"_resizeTransformTo",value:function(e){var t=this.getSharedState("transformOperation").getInputDimensions(!1),n=this.getSharedState("start").clone(),i=this.getSharedState("end").clone(),r=e.divide(t);i.copy(n).add(r),i.x>1&&(n.x-=i.x-1,i.x=1),i.y>1&&(n.y-=i.y-1,i.y=1);var o=this.props.controls.fixTransform(n,i,"right","bottom"),a=o.start,s=o.end,l=this.getSharedState("newTransformOptions");return l.start=a,l.end=s,this.setSharedState({start:a,end:s}),this._emitEvent(d.Constants.EVENTS.TRANSFORM_RESIZE),this._emitEvent(d.Constants.EVENTS.TRANSFORM_AFTER_EDIT),l}},{key:"render",value:function(){var e=this.getSharedState("ratio").getLockDimensions();return d.React.createElement(v,{className:void 0},d.React.createElement(b,null,d.React.createElement(E,{className:void 0,onClick:this._onLockDimensionsChange.bind(this),checked:e}),d.React.createElement(x,null,this._t("pesdk.transform.dimensions.lock")),d.React.createElement(k,null,d.React.createElement(w,null,d.React.createElement(g,{suffix:this._t("pesdk.transform.placeholder.width"),name:"width",disabled:this.props.disabled,value:this.state.nextDimensions.x,onLiveChange:this._onInputLiveChange.bind(this,"x"),onChange:this._onInputChange.bind(this,"x")})),d.React.createElement(S,null,d.React.createElement(y,{src:this._getAssetPath("editor/controls/transform/dimensions-cross.png",!0)})),d.React.createElement(w,null,d.React.createElement(g,{suffix:this._t("pesdk.transform.placeholder.height"),name:"height",disabled:this.props.disabled,value:this.state.nextDimensions.y,onLiveChange:this._onInputLiveChange.bind(this,"y"),onChange:this._onInputChange.bind(this,"y")}))),d.React.createElement(d.Transition,{active:this.props.disabled,enterProp:"rendered",enterDuration:300,appearProp:"visible",appearDuration:300,leaveDuration:300},d.React.createElement(C,{className:void 0}))))}}]),t}();m.contextTypes=d.SharedStateComponent.contextTypes,t.a=m;var g=Object(d.adonis)(d.SuffixedTextInputComponent)("cw1txx","DimensionInput"),y=d.adonis.img("1dew3s1","Cross"),v=d.adonis.div("1yz821h","TransformDimensions"),b=d.adonis.div("1po10b5","TransformDimensionsWrapper"),k=d.adonis.div("wlk9p6","Table"),w=d.adonis.div("1q481v0","Cell"),S=Object(d.adonis)(w)("13lk3i9","CrossCell"),C=d.adonis.div("943mx5",{rendered:"2jlos",visible:"rval4i"},"LockOverlay"),E=(d.adonis.img("k1z0lp","Lock"),Object(d.adonis)(d.CheckboxComponent)("15tfhjl","Checkbox")),x=Object(d.adonis)(_).div("t3ptdc","SectionTitle")},function(e,t,n){"use strict";function i(e){return function(){var t=e.apply(this,arguments);return new m.a(function(e,n){return function i(r,o){try{var a=t[r](o),s=a.value}catch(e){return void n(e)}if(!a.done)return m.a.resolve(s).then(function(e){i("next",e)},function(e){i("throw",e)});e(s)}("next")})}}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var o=n(9),a=n.n(o),s=n(0),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(117),h=n.n(d),_=n(8),m=n.n(_),g=n(1),y=n.n(g),v=n(7),b=(n.n(v),n(5)),k=n.n(b),w=n(387),S=n(388),C=n(51),E=a.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},x=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),l()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),T=void 0,O=void 0;v.Operations.SpriteOperation&&(T=v.Operations.SpriteOperation.TextDesignSprite,O=T.AssetManager);var R=function(e){function t(){var e,n,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return n=i=r(this,(e=t.__proto__||y()(t)).call.apply(e,[this].concat(a))),i.setColor=function(e){var t=i.context.editor,n=i.sharedState.get("selectedSprite");if(i.sharedState.set("color",e.clone()),n)n.setColor(e.clone()),i.addLocalHistorySnapshot("layout-color"),t.render();else{var r={color:e.clone()};i.sharedState.set(r),i.updateGlobalToolState(r)}},r(i,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,b.BaseControls),x(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.getOrCreate("sprite"),i=t.selectedSprite;if(i&&n.getSprites().indexOf(i)<0){var r=n.getSprites().filter(function(e){return e.getId()===i.getId()})[0];r&&(i=r)}var o=i?i.getLayout():null;return{selectedSprite:i,color:i?i.getColor():v.Color.WHITE,textAsMask:!!i&&i.getInverted(),selectedLayout:o?o.constructor.identifier:null}}},{key:"_onEnter",value:function(){var e=this.context.editor,t=new b.TextDesignManager(this.context.ui,this._options),n=new b.FontManager(this.context.ui,{fonts:b.Constants.DEFAULTS.TEXT_DESIGN_FONTS,replaceFonts:!0}),i=e.operations.getOrCreate("sprite");e.features.disable("zoom","drag"),e.zoom.auto(),this.sharedState.set({textDesignManager:t,fontManager:n,operation:i,color:v.Color.WHITE}),this.sharedState.get("selectedSprite")||this.createNewTextDesign().then(function(t){e.render()})}},{key:"_onLeave",value:function(){var e=this.context.editor;this.saveTextDesignSettings(),e.features.enable("zoom","drag")}},{key:"getLayoutItems",value:function(){var e=this.sharedState.get("textDesignManager");return this.constructor.TextDesignItems.filter(function(t){return e.getLayoutByIdentifier(t.identifier)})}},{key:"getText",value:function(){var e=i(h.a.mark(function e(){var t,n=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=b.ModalManager.instance.displayInput(this._t("pesdk.textdesign.title.input"),i),e.abrupt("return",new m.a(function(e,r){t.on("input",e),t.on("cancel",function(t){var o=n.sharedState.get("operation").getSprites().filter(function(e){return e instanceof T}).slice().reverse(),a=n.sharedState.get("selectedSprite")||o[0];if(a){var s=n.sharedState.get("selectedLayout")||a.getLayout().constructor.identifier;n.sharedState.set({selectedSprite:a,selectedLayout:s}),e(i)}else r(new Error("Input dismissed for first text design"))}),t.on("close",function(t){e(i)})}));case 2:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"editText",value:function(){var e=i(h.a.mark(function e(){var t,n,i,r,o;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sharedState.get("selectedSprite"),n=this.sharedState.get("operation"),i=this.context.editor,t){e.next=5;break}return e.abrupt("return");case 5:return r=t.getText(),e.next=8,this.getText(r);case 8:if((o=e.sent)&&""!==o.trim()){e.next=15;break}return n.removeSprite(t),t.dispose(),this.sharedState.set({selectedLayout:null,selectedSprite:null}),i.render(),e.abrupt("return");case 15:t.setText(o),this.addLocalHistorySnapshot("layout-text");case 17:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"createNewTextDesign",value:function(){var e=i(h.a.mark(function e(){var t,n,i,r,o,a,s,l,c,u,f=this,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sharedState.get(),n=t.textDesignManager,i=t.selectedSprite,r=t.operation,this.saveTextDesignSettings(),o=this.getGlobalToolState()||{},a=o.layout&&o.layout.constructor||n.getDefaultLayout().layout,s=p?n.getLayoutByIdentifier(p):a){e.next=7;break}return e.abrupt("return",null);case 7:return l=new s,e.prev=8,c=l.getImagePaths().map(function(e){return{path:e,fullPath:f._getAssetPath(e),image:null}}),e.next=12,O.loadImages(c);case 12:l.onImagesLoaded(),e.next=19;break;case 15:return e.prev=15,e.t0=e.catch(8),C.a.error(e.t0),e.abrupt("return");case 19:return u=E({color:this.sharedState.get("color"),inverted:this.sharedState.get("textAsMask"),width:.8},o,{layout:l}),e.next=22,this.getText();case 22:if(u.text=e.sent,u.text&&""!==u.text.trim()){e.next=25;break}return e.abrupt("return");case 25:return i=r.createTextDesign(u),r.addSprite(i),this.sharedState.set({selectedSprite:i}),this.addLocalHistorySnapshot("layout"),e.abrupt("return",i);case 30:case"end":return e.stop()}},e,this,[[8,15]])}));return function(){return e.apply(this,arguments)}}()},{key:"saveSpriteOptions",value:function(){this.saveTextDesignSettings()}},{key:"saveTextDesignSettings",value:function(){var e=this.sharedState.get("selectedSprite");e&&this.setGlobalToolState(e.serializeOptions(["layout","color","inverted"]))}},{key:"selectLayout",value:function(){var e=i(h.a.mark(function e(){var t,n,i,r,o,a,s,l=this,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sharedState.get(),n=t.textDesignManager,i=t.selectedSprite){e.next=3;break}return e.abrupt("return",this.createNewTextDesign(c));case 3:if(r=c?n.getLayoutByIdentifier(c):n.getDefaultLayout().layout){e.next=6;break}return e.abrupt("return",null);case 6:return o=new r,e.prev=7,a=o.getImagePaths().map(function(e){return{path:e,fullPath:l._getAssetPath(e),image:null}}),e.next=11,O.loadImages(a);case 11:o.onImagesLoaded(),e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(7),C.a.error(e.t0),e.abrupt("return");case 18:return s=this.context.editor,i.seed(),i.setLayout(o),this.addLocalHistorySnapshot("layout"),s.render(),e.abrupt("return",i);case 24:case"end":return e.stop()}},e,this,[[7,14]])}));return function(){return e.apply(this,arguments)}}()},{key:"_loadFonts",value:function(){var e=i(h.a.mark(function e(){var t,n;return h.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.sharedState.get("fontManager"),(n=this.context.ui.getFontLoader()).setFonts(t.getFonts()),O.setFonts(E({},O.getFonts(),t.getVariationsByIdentifier())),e.abrupt("return",n.load().catch(function(e){return e.map(function(e){return e.font.getFontFamily()})}));case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"loadFonts",value:function(){var e=this,t=void 0,n=window.setTimeout(function(){t=b.ModalManager.instance.displayLoading(e._t("pesdk.editor.text.loadingFonts"),!0)},600);return this._loadFonts().then(function(){window.clearTimeout(n),t&&t.close()}).catch(function(i){window.clearTimeout(n),t&&t.close();var r=i.join(", ");b.ModalManager.instance.displayError(e._t("pesdk.editor.title.fontLoadingError"),e._t("pesdk.editor.text.fontLoadingError",{fonts:r}))})}}],[{key:"clickAtPosition",value:function(e,t){var n=t.operations.get("sprite");if(!n)return!1;var i=n.getSpritesAtPosition(e,t.getOutputTextureDimensions()).filter(function(e){return e instanceof T});return!!i[0]&&{selectedSprite:i[0]}}},{key:"isEnabled",value:function(e){return e.isToolEnabled("textdesign")&&e.isToolAllowed("textdesign")}},{key:"getPreloadAssets",value:function(e){var t=[];return this.TextDesignItems.forEach(function(e){t.push(e.backgroundImagePath)}),t}}]),t}();R.identifier="textdesign",R.controlsComponent=w.a,R.canvasControlsComponent=S.a,R.iconPath="editor/controls/text-design/icon.png",R.activeIconPath="editor/controls/text-design/icon-active.png",R.requiredOperations=["sprite"],R.updatableOperations=["sprite"],R.switchToDefaultControlsOnRemoval=!0,R.defaultOptions={availableLayouts:null},R.TextDesignItems=[{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_thislayoutisgreat.png",identifier:"imgly_text_design_blocks"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_fatandfast.png",identifier:"imgly_text_design_rotated"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_summerfeeling.png",identifier:"imgly_text_design_blocks_light"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_typewithstyle.png",identifier:"imgly_text_design_equal_width"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_inthebox.png",identifier:"imgly_text_design_masked"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_bluefriday.png",identifier:"imgly_text_design_celebrate"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_decorative.png",identifier:"imgly_text_design_sunshine"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_specialdeals.png",identifier:"imgly_text_design_masked_badge"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_doublelines.png",identifier:"imgly_text_design_blocks_condensed"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_celebrate.png",identifier:"imgly_text_design_celebrate_simple"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_beerandburger.png",identifier:"imgly_text_design_equal_width_fat"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_watercolor.png",identifier:"imgly_text_design_watercolor"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_particle.png",identifier:"imgly_text_design_particles"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_yeah.png",identifier:"imgly_text_design_masked_speech_bubble"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_thisisadream.png",identifier:"imgly_text_design_masked_speech_bubble_comic"},{backgroundImagePath:"editor/controls/text-design/icons/imgly_text_design_icon_fat_face.png",identifier:"imgly_text_design_multiline"}],k.a.Controls.TextDesignControls=R,t.a=R},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}());d.GroupedControlsStyles.ControlGroupTitle;var _=d.GroupedControlsStyles.ControlGroup,m=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._events={},o._unavailableFontFamilies=[];var a=null,s=i[0].controls._options;return s&&s.colors&&(a=s.colors),o.state={colorPalette:a},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),h(t,[{key:"componentDidMount",value:function(){(function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0})(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this.props.controls.loadFonts()}},{key:"shouldSharedComponentUpdate",value:function(e,t){return!0}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"onSelectLayout",value:function(e){var t=this;this.props.controls.selectLayout(e).then(function(){t.forceUpdate(),t.context.editor.render()})}},{key:"onTextDesignNewClick",value:function(e){e.preventDefault(),this.props.controls.createNewTextDesign()}},{key:"_renderContent",value:function(){var e=this,t=this.sharedState,n=t.color,i=t.selectedLayout,r=this.props.controls,o=r.getLayoutItems(),a=i?i.replace(/-v[\d]_[\d]_[\d]$/g,""):void 0;return d.React.createElement(g,null,d.React.createElement(k,null,d.React.createElement(d.ButtonComponent,{title:this._t("pesdk.textdesign.button.new"),onClick:function(t){return e.onTextDesignNewClick(t)},className:void 0}),d.React.createElement(S,null,d.React.createElement(d.ColorSelectionComponent,{value:n,colorPalette:this.state.colorPalette,onChange:r.setColor}))),d.React.createElement(w,null,d.React.createElement(d.ScrollbarComponent,{direction:"vertical"},d.React.createElement(v,null,o.map(function(t){return d.React.createElement(b,{key:t.identifier,className:void 0,selected:t.identifier===a,onClick:function(){return e.onSelectLayout(t.identifier)}},d.React.createElement(y,{src:t.identifier===a?e._getAssetPath("editor/controls/text-design/icons/imgly_icon_next_48pt.png",!0):e._getAssetPath(t.backgroundImagePath,!0)}))})))))}}]),t}();m.contextTypes=d.ControlsComponent.contextTypes,m.RootElement=d.ControlsComponent.RootElement,t.a=m;var g=d.adonis.div("w4knew","Container"),y=d.adonis.img("95qw31","Image"),v=d.adonis.ul("13wctlp","List"),b=d.adonis.li("18c5asb",{selected:"1eawvu9"},"ListItem"),k=Object(d.adonis)(_).div("1lqw49n","Settings"),w=Object(d.adonis)(_).div("qf5p21","SettingsBottom"),S=d.adonis.div("10jnb6m","ColorSelection")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(6),l=n.n(s),c=n(2),u=n.n(c),f=n(3),p=n.n(f),d=n(1),h=n.n(d),_=n(7),m=(n.n(_),n(5)),g=(n.n(m),n(58)),y=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),b=void 0;_.Operations.SpriteOperation&&(b=_.Operations.SpriteOperation.TextDesignSprite);var k=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||h()(t)).call.apply(e,[this].concat(i)));return o.state=y({},o.state,{visible:!0}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=p()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(u.a?u()(e,t):e.__proto__=t)}(t,g.a),v(t,[{key:"_renderSpriteItems",value:function(e){return function e(t,n,i){null===t&&(t=Function.prototype);var r=l()(t,n);if(void 0===r){var o=h()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||h()(t.prototype),"_renderSpriteItems",this).call(this,e.filter(function(e){return e instanceof b}))}},{key:"_selectNextSprite",value:function(){for(var e=this.getSharedState("operation").getSprites().slice(0).reverse(),t=void 0,n=void 0,i=0;i<e.length;i++)if((t=e[i])instanceof b){n=t;break}n||(this.props.controls.skipHistory=!0,this.context.mediator.emit(m.Constants.EVENTS.SPRITES_DESELECTED)),this.setSharedState({selectedSprite:n||null}),this.context.screen.refreshControlsComponent()}},{key:"_createSprite",value:function(e){return this.getSharedState("operation").createTextDesign(e)}}]),t}();k.contextTypes=g.a.contextTypes,t.a=k},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(1),u=n.n(c),f=n(7),p=n.n(f),d=n(5),h=n.n(d),_=n(390),m=n(60),g=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),y=p.a.Operations.ArtFilterOperation,v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||u()(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,d.BaseControls),g(t,[{key:"mapOperationsToSharedState",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];var t=e.get(y.identifier)||null;return{operation:t,identifier:t?t.getIdentifier():null,intensity:t?t.getIntensity():1,blendMode:t?t.getBlendMode():m.a.normal,disableArtFilter:function(){t&&e.remove(t)},setArtFilter:function(t){e.getOrCreate(y.identifier).set(t)},getArtFilter:function(){return t?{identifier:t.getIdentifier(),styleTransferModel:t.getStyleTransferModel()}:null},setIntensity:function(e){t&&t.setIntensity(e)},setBlendMode:function(e){t&&t.setBlendMode(e)},setOperationOptions:function(e){t&&t.set(e)},setIdentifier:function(e){t&&t.setIdentifier(e)}}}}],[{key:"isEnabled",value:function(e){if(!e.isShallow){var n=e.getSDK();return(!n||!n._fl())&&e.isToolEnabled(t.identifier)&&e.isToolAllowed(t.identifier)&&y.isSupported(e.getSDK())}return!1}},{key:"getPreloadAssets",value:function(e){var t=[],n=e.getOptions();return new d.ArtFilterManager(e.getUI(),f.Utils.defaults(n.editor.controlsOptions.style,this.defaultOptions)).getArtFilters().forEach(function(e){void 0!==e.thumbnail&&t.push([e.thumbnail,!1])}),t}}]),t}();v.identifier="artfilter",v.controlsComponent=_.a,v.canvasControlsComponent=d.BaseControls.canvasControlsComponent,v.iconPath="editor/controls/art-filter/icon.png",v.activeIconPath="editor/controls/art-filter/icon-active.png",v.requiredOperations=[],v.updatableOperations=[y.identifier],v.switchToDefaultControlsOnRemoval=!1,v.defaultOptions={categories:[],replaceCategories:!1,availableArtFilters:null},h.a.Controls.ArtFilterControls=v,t.a=v},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(6),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(4)),_=n(25),m=n(89),g=n(391),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),v=function e(t,n,i){null===t&&(t=Function.prototype);var r=a()(t,n);if(void 0===r){var o=p()(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},b=d.ControlsStyles.PlainControlItem,k=d.ControlsStyles.PlainControlItemBackground,w=d.ControlsStyles.ControlItemTitle,S=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));o._bindAll("_onIntensityChange","_onBlendModeChange");var a=o.context,s=a.ui,l=(a.editor,a.theme);return o._loadedArtFilters=[],o._thumbnailLoadQueue=new m.a(1,1/0,l.listItemSlideInDelay),o._thumbnailsLoaded={},o._artFilterManager=new d.ArtFilterManager(s,o.props.options),o._artFilterPreviews=[],o._category="all",o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.ControlsComponent),y(t,[{key:"componentDidMount",value:function(){v(t.prototype.__proto__||p()(t.prototype),"componentDidMount",this).call(this),this._loadThumbnails()}},{key:"componentWillUnmount",value:function(){v(t.prototype.__proto__||p()(t.prototype),"componentWillUnmount",this).call(this),this._disposed=!0,window.clearInterval(this._interval)}},{key:"_loadThumbnails",value:function(){var e=this;this._artFilterManager.getArtFilters().forEach(function(t){e._thumbnailLoadQueue.add(function(){return _.a.load(e._getAssetPath(t.thumbnail)).then(function(n){e._thumbnailsLoaded[t.identifier]=n,e.forceUpdate()})})})}},{key:"_onBlendModeChange",value:function(){this.props.controls.addLocalHistorySnapshot("artfilter-blend-mode",!1)}},{key:"_onIntensityChange",value:function(){this.props.controls.addLocalHistorySnapshot("artfilter-intensity",!0)}},{key:"_onItemClick",value:function(e){var t=this;if(e&&"none"!==e){if(e!==this.sharedState.identifier){var n=this.sharedState.getArtFilter();n?this._artFilterManager.updateLoadedModelWithWeightsForIdentifier(n.styleTransferModel,e).then(function(){t.sharedState.setArtFilter({identifier:e})}).catch(function(){n.styleTransferModel.dispose(),t._loadArtFilterWithIdentifier(e,t.context.ui.translate("pesdk.common.text.updating"))}):this._loadArtFilterWithIdentifier(e,this.context.ui.translate("pesdk.common.text.loading"))}}else this.sharedState.disableArtFilter()}},{key:"_loadArtFilterWithIdentifier",value:function(e,t){var n=this,i=this,r=d.ModalManager.instance.displayProgress(t);this._artFilterManager.instantiateStyleTransferModelForArtFilterWithIdentifier(e).then(function(t){n.sharedState.setArtFilter({identifier:e,styleTransferModel:t}),r&&r.close(),n.props.controls.addLocalHistorySnapshot("artfilter-model",!1),i.context.editor.render()}).catch(function(e){h.h.error("Could not instantiate art filter! "+e)})}},{key:"_renderListItems",value:function(){var e=this,t=this._artFilterManager.getArtFiltersForCategory(this._category),n=this.sharedState.identifier;return t.map(function(t){var i=t.identifier,r=i===n;return d.React.createElement(E,{key:i,className:void 0},d.React.createElement(g.a,{ref:"artfilter-"+i,key:i,artFilter:t,selected:r,visible:!!e._thumbnailsLoaded[t.identifier],onClick:e._onItemClick.bind(e,i),onBlendModeChange:e._onBlendModeChange,onIntensityChange:e._onIntensityChange}))})}},{key:"_getRootProps",value:function(){return{className:void 0,withBorderTop:!0}}},{key:"_renderContent",value:function(){var e=this,t=null===this.sharedState.identifier;return d.React.createElement(d.ScrollableListComponent,{direction:"vertical",innerRef:function(t){e._scrollbar=t}},d.React.createElement(C,null,d.React.createElement(x,{onClick:this._onItemClick.bind(this,null)},d.React.createElement(T,{selected:t},d.React.createElement(O,null,this.context.ui.translate("pesdk.artfilter.asset.none")))),this._renderListItems()))}}]),t}();S.contextTypes=d.ControlsComponent.contextTypes,S.propTypes=d.ControlsComponent.propTypes,S.RootElement=d.ControlsComponent.RootElement,t.a=S;var C=d.adonis.ul("9uviv9","List"),E=d.adonis.li("13hv8io","ListItemContainer"),x=Object(d.adonis)(b).div("1sgdmny","NoneItem"),T=Object(d.adonis)(k).div("yogtp1","NoneItemBackground"),O=Object(d.adonis)(w).span("5krmrh","ItemTitle")},function(e,t,n){"use strict";var i=n(9),r=n.n(i),o=n(0),a=n.n(o),s=n(2),l=n.n(s),c=n(3),u=n.n(c),f=n(1),p=n.n(f),d=n(5),h=(n.n(d),n(392)),_=r.a||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),a()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=d.ControlsStyles.ControlItem,y=d.ControlsStyles.ControlItemActiveOverlay,v=d.ControlsStyles.ControlItemTitle,b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o.state={hovered:!1},o._bindAll("_onBlendModeChange","_onIntensityChange"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=u()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(l.a?l()(e,t):e.__proto__=t)}(t,d.SharedStateComponent),m(t,[{key:"_onBlendModeChange",value:function(e){this.sharedState.setBlendMode(e),this.props.onBlendModeChange&&this.props.onBlendModeChange()}},{key:"_onIntensityChange",value:function(e){this.sharedState.setIntensity(e),this.props.onIntensityChange&&this.props.onIntensityChange()}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.selected!==e.selected||this.props.visible!==e.visible||this.state.hovered!==t.hovered||this.props.filter!==e.filter||!(this.props.intensity===e.intensity||!e.selected)}},{key:"render",value:function(){var e=this,t=this.props,n=t.lastChild,i=t.onClick,r=t.selected,o=t.visible,a=t.artFilter,s=this.context.ui,l=this.sharedState.intensity,c=this.sharedState.blendMode,u={lastChild:n,onClick:i,visible:o};return a&&(u.style={backgroundImage:"url('"+this._getAssetPath(a.thumbnail)+"')"}),d.React.createElement(k,_({},u,{className:void 0,animated:!0,innerRef:function(t){e._container=t},onMouseEnter:function(){return e.setState({hovered:!0})},onMouseLeave:function(){return e.setState({hovered:!1})}}),d.React.createElement(S,{selected:r},d.React.createElement(d.Transition,{active:!r},d.React.createElement(x,null,d.React.createElement(C,{hovered:this.state.hovered},s.translate("pesdk.art-filters.asset."+(a?a.identifier:"none"))||(a?a.defaultName:"None")))),d.React.createElement(d.Transition,{active:r},d.React.createElement(x,null,d.React.createElement(E,null,"Blending"),d.React.createElement(O,{value:c,onChange:this._onBlendModeChange}),r&&d.React.createElement(w,null,d.React.createElement(d.SliderComponent,{minValue:0,maxValue:1,valueUnit:"",middleDot:!1,value:l,onChange:this._onIntensityChange})),d.React.createElement(T,{rendered:!0,visible:!0})))))}},{key:"container",get:function(){return this._container}}]),t}();b.contextTypes=d.SharedStateComponent.contextTypes,t.a=b;var k=Object(d.adonis)(g).div("193vjnw",{lastChild:"229bd5"},"Item"),w=d.adonis.div("12dmntm","Slider"),S=d.adonis.div("1m161zg","ItemContainer"),C=Object(d.adonis)(v).span("120drhm","ItemTitle"),E=Object(d.adonis)(C)("1kbikta","BlendingLabel"),x=d.adonis.div("tj7k39",{rendered:"cuo4v2",visible:"82svov"},"ItemContent"),T=Object(d.adonis)(y).div("120drhm","Overlay"),O=Object(d.adonis)(h.a)("ii685b","BlendingControl")},function(e,t,n){"use strict";var i=n(0),r=n.n(i),o=n(2),a=n.n(o),s=n(3),l=n.n(s),c=n(43),u=n.n(c),f=n(1),p=n.n(f),d=n(7),h=(n.n(d),n(5)),_=(n.n(h),n(60)),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),r()(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),g=h.ControlsStyles.ControlItemTitle,y=d.Utils.flipObject(_.a),v=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||p()(t)).call.apply(e,[this].concat(i)));return o._bindAll("_onPreviousClick","_onNextClick"),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=l()(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(a.a?a()(e,t):e.__proto__=t)}(t,h.BaseComponent),m(t,[{key:"_onPreviousClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=u()(y),n=(t.indexOf(this.props.value.toString())+t.length-1)%t.length,i=parseInt(t[n],10);this.props.onChange&&this.props.onChange(i)}},{key:"_onNextClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=u()(y),n=(t.indexOf(this.props.value.toString())+t.length+1)%t.length,i=parseInt(t[n],10);this.props.onChange&&this.props.onChange(i)}},{key:"render",value:function(){var e={backgroundImage:"url('"+this._getAssetPath("editor/controls/overlay/arrow-left.png",!0)+"')"},t={backgroundImage:"url('"+this._getAssetPath("editor/controls/overlay/arrow-right.png",!0)+"')"},n=this.props.value,i=this.context.ui;return h.React.createElement(b,{styles:this.props.styles},h.React.createElement(w,{onClick:this._onPreviousClick,style:e}),h.React.createElement(k,null,i.translate("pesdk.overlay.title."+y[n])),h.React.createElement(w,{onClick:this._onNextClick,style:t}))}}]),t}();v.contextTypes=h.BaseComponent.contextTypes,t.a=v;var b=h.adonis.div("15zte1z","BlendingControlContainer");v.RootElement=b;var k=Object(h.adonis)(g).div("1v7ogyl","Label"),w=h.adonis.div("1v32l0l","Arrow")}])});
//# sourceMappingURL=photo-editor-sdk.ui.desktop-ui.map.js